Hiya Jason Simple demo here: http://jsfiddle.net/Y9dBG/
Hope this helps the example below is very basic as you i.e. replica of what you were trying. :)
Helpful link: (incase you want to use regex) Decimal or numeric values in regular expression validation
Quote (If you will use regex the link above should be helpful and quoting from above link :) But that should be only in case if you are looking to implement regex.
Rest hope this helps you, cheers!
Further update to handle commas and full stops
If you want to allow a . between groups of digits and a , between the
integral and the fractional parts then try:
^[1-9]\d{0,2}(.\d{3})*(,\d+)?$
Jquery COde
alert('html value ==>' + $(".XT_Active").html().toString() );
alert('comparision ==>' + ($(".XT_Active").html().toString() == "½"));
if ($(".XT_Active").text() == "½") {
// alert('foo ====' + $(".XT_Active").text());
//Do stuff
}
if ($(".XT_Active").text() == "½") {
alert('Yay I am inside the if condition' + $(".XT_Active").text());
//Do stuff
}
HTML
<!-- <div class="XT_Active"> ½</div> <br /> -->
<span class="XT_Active">½</span> <br />