Forum Moderators: open
I have a simple page with javascript. All I want to do is show the contents of <noscript> in case javascript is disabled but hide all other contents as well.
For example:
<div id="whatever">some content here</div>
<div id="whatever2">some other content requiring javascript here</div>
<div id="whatever3">some more content here</div>
<noscript>some content here</noscript>
What I want:
if no javascript hide all divs and of course display the noscript
How do I do it?
Thank you,
krko
<style>
.hide div {
display:none;
}
</style>
<script type="javascript/text">
window.onload = document.getElementById("contentHide").className = "";
</script>
<div id="contentHide" class="hide">
<div id="whatever">some content here</div>
<div id="whatever2">some other content requiring javascript here</div>
<div id="whatever3">some more content here</div>
</div>
<noscript>some content here</noscript>