Question

Is it possible to invoke the <noscript> element even when JavaScript is enabled? I need to toggle it's visibility for demonstration purposes of what it will look like.

Was it helpful?

Solution

You can create a new <div> element with contents from the <noscript> and then remove it after demonstration:

// to create
var div = document.createElement("div");
div.innerHTML = document.getElementsByTagName("noscript")[0].innerHTML;
document.body.appendChild(div);

// to remove
document.body.removeChild(div);

OTHER TIPS

<noscript>stuff</noscript>
<div id="mydiv"><div>

$('#mydiv').text($('noscript').text());

http://jsfiddle.net/5pDBT/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top