Skip to content

Detect if JavaScript is disabled in a browser

To detect if JavaScript is disabled in a web browser, use the <noscript> tag. <noscript> tag block will be executed if JavaScript is not enabled in your browser. The HTML <noscript> tag is used to handle the browsers, which do recognize <script> tag but do not support scripting. This tag is used to display an alternate text message.

<!DOCTYPE html>
<html>
   <head>
      <title>HTML noscript Tag to detech if Js is enabled</title>
   </head>

   <body>
      <script>
         <!--
            document.write("Hello JS!")
         -->
      </script>
     
      <noscript>
         Your browser does not support JavaScript!
      </noscript>
   </body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.