Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Javascript to show/hide div

SpaceshipSpaceship
SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
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: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back