mpen mpen - 10 months ago 61
HTML Question

How to change textContent of TextNode in IE8?

textNode.innerHTML = 'abc'
textNode.textContent = 'abc'
do not appear to work in IE8. Per MSDN,
only works in IE9+.

So how can I change the text of a
in IE8?

To be clear, I'm talking about an HTML node with
nodeType === 3
, I do not want nor care about changing the text of an HTML element.

Answer Source

textNode.nodeValue = 'abc' should work fine.