문제

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.

도움이 되었습니까?

해결책

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);

다른 팁

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

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

http://jsfiddle.net/5pDBT/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top