Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

checking javascript is enabled

I am building a html page. I was to make a quick 1 line test which, if the user has javascript enabled says "javascript on" otherwise says "javascript off" just to let them know.

How can I do this?

like image 995
David19801 Avatar asked Apr 16 '26 10:04

David19801


1 Answers

<div id="js_onoff">JavaScript off :(</div>
<script>
    document.getElementById("js_onoff").innerHTML = "JavaScript on, yeah! :)";
</script>
like image 138
Marcel Korpel Avatar answered Apr 18 '26 00:04

Marcel Korpel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!