Jump to content

Hiding element if JS is off?


msaz87

Recommended Posts

Hey all,

 

Just a quick question... I was wondering how to hide an element if JS is disabled -- so basically the inverse of the <noscript> tags. Is this possible?

 

I have a <div> that opens as the page is loading and closes via a JS function, but obviously I want this hidden if the user's JS is turned off.

 

Any ideas or help is greatly appreciated -- thanks!

Link to comment
https://forums.phpfreaks.com/topic/184632-hiding-element-if-js-is-off/
Share on other sites

Hey all,

 

Just a quick question... I was wondering how to hide an element if JS is disabled -- so basically the inverse of the <noscript> tags. Is this possible?

 

I have a <div> that opens as the page is loading and closes via a JS function, but obviously I want this hidden if the user's JS is turned off.

 

Any ideas or help is greatly appreciated -- thanks!

 

Just set its display to 'none' in your CSS.  If JavaScript is enabled, you can change it to 'block' on page load.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.