Forum Moderators: open
I've searched around, and though this seems like a FAQ, I can't find anything on it. The question is simple. I'm using nodeValue to change the content of a text node. That works just fine. However, if the text I replace contains any HTML, that HTML is printed out verbatim, rather than being interpreted.
For example:
commentArray[0] = "This is a comment. Read more <a href=\"http:\\www.website.com/place\">here</a>.";....
document.getElementById('commenttext').childNodes[0].nodeValue = commentArray[0];
....
<div>
Comments: <span id="commenttext">Blah blah.</span>
</div>
Prints out the html verbatim (without the backslashes, of course). Is this normal, and is there a way around it.