Is the following HTML/Javascript valid (strict) when Javascript is enabled? Is the id in the noscipt tag ignored?
<body>
<noscript>
<div id="test"></div>
</noscript>
<script type="text/Javascript">
var el = document.createElement('span');
el.id = 'test';
document.body.appendChild(el);
</script>
</body>
When javascript is enabled, the content of
<noscript>is raw text, not element content, so the child of the<noscript>element is a text node with value"\n <div id="test"></div>\n"instead of a DIV element. AgetElementById("test")will not find a<div>with the ID"test"because there is no such element, only a text node whose content would parse to a DIV if it appeared outside a raw text context.http://www.w3.org/TR/html5/scripting-1.html#the-noscript-element