Javascript to show/hide div

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch
Impact
25
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.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
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
CatchedCatched

We're social

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