Javascript to show/hide div

SpaceshipSpaceship
Watch
Impact
24
Hi,

I want to display a div if the user has javascript enabled and display nothing if javascript is disabled.

Any help is greatly appreciated.

Thanks!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
I think that that'd be simply:

Code:
<script type="text/javascript">
document.write('<div>JavaScript is enabled, hence why you are seeing this.</div>');
</script>
<noscript>
</noscript>

The <noscript> tags aren't necessarily needed; feel free to remove them.
 
1
•••
Worked perfectly. Thanks! Rep + NP$ sent.
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy — Zero Commission
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back