I\'m wondering if there\'s a way to change the text of anything in HTML without using innerHTML.
Reason I\'m asking is because it\'s kinda frowned upon by the W3C. I
I sometimes find it helpful to store a direct reference to the text node if I am going to be updating it regularly. I do something like this:
var dynamicText = myDiv.appendChild(document.createTextNode("the initial text"));
And then whenever I need to update it, I just do this:
dynamicText.nodeValue = "the updated text";
This prevents having to walk the DOM or add or remove any children.