if($("#Fees_ProfitType:checked").attr("val") == 29751)
{
FormatAsMoney(this, 10000000000, true);
}
else if($("#Fees_ProfitType:checked").val() == 29751)
{
FormatAsMoney(this, 10000000000, true);
}
So I have this setup in javascript. When it runs through for Firefox, it notices the first if() as undefined, so it runs to the second, and formats the field.
When I run it through as IE it calls if($("#Fees_ProfitType:checked").attr("val"), and returns 29751, however when I compare them, it doesn’t equal and won’t alert.
What am I doing wrong?
It is possible that the value returned be a string.
So, try to do this:
Or this:
Cheers