If javascript is disabled, I want to hide a div
. If javascript is enabled, however, I don't want to rely on using the <noscript>
tag due to issues in Chrome and Opera. Instead, my approach is as follows:
<div id="box" style="display:none"></div>
<script type="text/javascript">
document.getElementById("box").style.visibility = "visible";
</script>
Despite trying out the above code snippets, the div does not become visible when javascript is enabled. I also attempted to use $('#box').show();
, but that did not yield the desired result either.