开发者

Weirdness using jquery's .html() function to set <a></a> with a special character &#10003; (checkmark)

I'm trying to have the following tag toggle between a "-" and the checkmark character (&#10003)

<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('&#10003'); }

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("&#10003")

Thanks, Sam


Don't forget the trailing semicolon:

button.html('&#10003;');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜