I want to parse tags like and into document.body.innerHTML (see below). However although you can do this in Chrome, it doesn't work in IE.I have to get it to work in IE butit seems that isn't possible. Any ideas?
html = '<script> function myFunction() { alert(); } </script>AAA'
doc.body.innerHTML = html
AAA is stored in doc.body.innerHTML
To quickly replicate the issue just add the first line below to the IE console window then see what is in document.body.innerHTML and you will notice its been stripped.
We use a 10 year old text editor which will only work in IE and has always stripped javascript so now I've discovered why and was hoping someone could provide an alternative...googling isn't helping much
document.body.innerHTML = "<script> function myFunction() { alert(); } </script>AAA"
document.body.innerHTML
"AAA"