Open In App

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

Last Updated : 10 Jul, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads