update html text 1

update html text

Here is what the above code is Doing:
1. Create a new text node with the value “old value”
2. Create a new script element
3. Append the text node to the script element
4. Append the script element to the document body
5. Change the text node’s value to “new value”

The above code will not work in IE. The reason is that IE does not allow you to change the value of a text node that is a child of a script element. The workaround is to create a new text node and replace the old one with the new one. Here’s the code:

Similar Posts