#39;innerText#39; works in IE, but not in Firefox(innerText 在 IE 中有效,但在 Firefox 中无效)
问题描述
I have some JavaScript code that works in IE containing the following:
myElement.innerText = "foo";
However, it seems that the 'innerText' property does not work in Firefox. Is there some Firefox equivalent? Or is there a more generic, cross browser property that can be used?
Firefox uses the W3C-compliant textContent property.
I'd guess Safari and Opera also support this property.
这篇关于'innerText' 在 IE 中有效,但在 Firefox 中无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!