I’ve got a list of spans, containing numbers. I know how to extract numbers from span, that’s easy, but one of my span is ½ character entity.
if ($(".XT_Active").html().text() === "½") {
//Do stuff
}
if ($(".XT_Active").text() === "½") {
//Do stuff
}
I need it to evaluate to true. Neither of these work.
Any tips?
SOLUTION
I moved this to a different, more appropriate function. The above evaluated before the class XT_Active could be given.
It’s all good now. Thanks again everyone!
It seems to work for me. Perhaps you have whitespace in your span.
http://jsfiddle.net/YL5Aj/
If that’s not the issue you could try encoding the html entities using this technique
HTML-encoding lost when attribute read from input field
http://jsfiddle.net/gZuab/