开发者

JavaScript innerHTML causing css to disappear on <button>

I have a button tag with two spans inside;

<button><span><span id="buttonText">Save</span></span></button>

I'm trying to make it so that when you click the button the text changes so I have;

onclick="document.getElementById('buttonText').innerHTML = 'Saving...'; this.style.className"

Now funni开发者_StackOverflow社区ly enough it works fine in IE8, but testing in Firefox and Chrome, both lose the css sliding doors styles I have set up on the button and the spans.


How about manipulating nodeValue instead? .firstChild.nodeValue if memory serves me right.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜