Skip to content
Related Articles

Related Articles

How to set alternate content for users that do not support client-side scripts ?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 10 Jul, 2020

In this article, we define an alternate content for users that do not support client-side scripts by using <noscript> tag in the HTML document. It is used to display the text for those browsers that does not support script tag or the browsers disable the script for the user.

Syntax:

<noscript> Contents... </noscript>

Example:




<!DOCTYPE html>
<html>
  
<head>
    <style>
        body {
            text-align: center;
        }
  
        .gfg {
            font-size: 40px;
            font-weight: bold;
            color: green;
        }
  
        .geeks {
            font-size: 25px;
            font-weight: bold;
        }
    </style>
  
    <noscript>
        Sorry, your browser does 
        not support JavaScript!
    </noscript>
</head>
  
<body>
    <div class="gfg">
        GeeksforGeeks
    </div>
      
    <div class="geeks">
        How to define an alternate content
        for users that do not support 
        client-side scripts?
    </div>
      
    <script>
        document.write("GeeksforGeeks!") 
    </script>
</body>
  
</html>           

Output:

Supported Browser are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!