I have an HTML document that looks something like this:
...
<p>Ambient temperature:</p>
<p class="big"><span id="ambientTempValue">23.6</span> <span id="ambientTempUnit">℃</span></p>
...
I want to compare the value of #ambientTempUnit to check whether it's Fahrenheit or Celsius, but since the unit is in hex encoded format, jQuery simply returns the decoded version (degree of Celsius in this example). So, the question is, how can I compare those. There's probably a function that decodes the hex value but I had no luck finding it on Google. Thank you in advance!
It's a decimal number, formulated as a XML character reference.
$('<span>℃</span>').text() === String.fromCodePoint(8451);
$('<span>℃</span>').text().charCodeAt(0) === 8451;
<!DOCTYPE html>
<html>
<body>
<p>Ambient temperature:</p>
<p class="big"><span id="ambientTempValue">23.6</span> <span id="ambientTempUnit">℃</span></p>
<p id="demo"></p>
<script>
if(document.getElementById("ambientTempUnit").innerHTML == "℃"){
document.getElementById("demo").innerHTML = "It's like totaly celsius man";
}
if(document.getElementById("ambientTempUnit").innerHTML == "℉"){
document.getElementById("demo").innerHTML = "It's like totaly fahrenheit man";
}
if(document.getElementById("ambientTempUnit").innerHTML == "K"){
document.getElementById("demo").innerHTML = "It's like totaly kelvin man";
}
</script>
</body>
</html>
error: selenium.common.exceptions.TimeoutException: Message:
jetpack compose not responding to keyboard input on emulator
Hexagon Grid CSS - All hexagons change size when each of them is clicked
How to render HTML pages as PNG/JPEG images with URL array using Javascript only?
Get count of items that matches a condition from mongo db in node js
I am looking for a plugin that could make a modal type form as the example of the image, i have tried with tolltipster plugin with no luck
I dont understand why returned false2 html form 1 for update image, main form for save entity