I'm trying to get the content of a tag using Javascript. I succesfully managed to get it in FF, Chrome, Opera and even IE6 but fail on IE7 (haven't tried IE8+ yet).
Basically, here's the reduced code version :
<noscript>Lorem ipsum</noscript>
<script>
var noscript = document.getElementsByTagName('noscript')[0];
noscript.textContent; // undefined
noscript.innerHTML; // empty string
noscript.childNodes.length; // 0
</script>
I tried adding element inside and targeting them, no success. I tried to wrap in a parent element and getting its .innerHTML
, but anything between tags is discarded.
Note : I'm building a lazyloader script and the element is just what I need (
src
attributes inside a tag are not fetched by the browser.)