Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

What is the Tag?

The <noscript> tag is used to display a custom message or content for users whose browsers have JavaScript disabled (or do not support JavaScript at all). If JavaScript is disabled, users will see the content inside this tag. If JavaScript is enabled, the content inside <noscript> will not be visible.


What Is It Used For?

  1. Display Warning Message: If your website relies heavily on JavaScript for critical features, you can show a message recommending the user to enable JavaScript or use another browser.
  2. Provide Alternative Content: In case JavaScript is disabled, you can offer limited but usable versions of some site features — for example, a basic version of a gallery or form validation.
<noscript>
  JavaScript is not enabled. Please enable JavaScript in your browser.
</noscript>

How to Use It?

You can place the <noscript> tag inside either the <head> or <body> sections of the page.
Tip: Make sure it is placed in a visible area so that users can actually see the message.
When used alongside a <script> tag, the <noscript> content will only appear if JavaScript is disabled.

Example usage:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Sample Page</title>
  <noscript>
    JavaScript is disabled. Please enable it.
  </noscript>
</head>
<body>
  <h1>Homepage</h1>
  <p>This paragraph is visible when JavaScript is enabled.</p>

  <script src="script.js"></script>
</body>
</html>

  • If JavaScript is enabled, the <noscript> tag will not display any content.
  • If JavaScript is disabled, the warning message inside <noscript> will be shown to the user.

Why Is It Important?

Accessibility: Although most modern browsers support JavaScript, some users may disable it for security or performance reasons. In such cases, if you want to ensure access to your site’s basic functionality, you can use <noscript> to display a warning or provide alternative content.

SEO Impact: While most search engine bots are capable of processing JavaScript, some still scan <noscript> content as well. Therefore, including basic messages, navigation tips, or key content inside <noscript> may occasionally be beneficial — as long as it’s not overused.


Summary

The <noscript> tag is a useful HTML element for displaying important messages or fallback content when JavaScript is disabled. It allows you to provide users or bots with at least a basic message or navigation path in the absence of JavaScript.