Dynadot Black Friday and Cyber Monday 2026: save more on domains. See our sales.

Javascript to show/hide div

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
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
Close
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
Close
Worked perfectly. Thanks! Rep + NP$ sent.
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

New: watch any domain
You can now watch domains on NamePros. We check each one and notify you when something changes. Search for a domain and press Watch on...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back