Weirdness using jquery's .html() function to set <a></a> with a special character ✓ (checkmark)
I'm trying to have the following tag toggle between a "-" and the checkmark character (✓)
<a id='p_4' cl开发者_JS百科ass='fancy_button orange bls_button' href='#'>-</a>
And here's the jquery code:
if (button.text() == '-') {
button.html('✓'); }
This works in FF3.6 and IE8, but not in WebKit (Chrome or iPhone safari).
Is there something I'm doing wrong, or does webkit just not like .html("✓")
Thanks, Sam
Don't forget the trailing semicolon:
button.html('✓');
精彩评论