<noscript>

Displays something for browsers that can't use JavaScript.
2 min read
Believemy logo

The <noscript> tag is used to provide alternative content to users whose browser does not support JavaScript or has disabled its execution.

It ensures a certain level of accessibility and a minimal experience, even in the absence of JavaScript-based functionalities. JavaScript.

Good to know

This tag is particularly useful for sites where JavaScript is essential, such as single-page applications (SPA for Single Page Application: sites built with React, for example).

 

Structure and syntax of the <noscript> tag

Basic structure and syntax

The <noscript> tag is a container tag used to enclose alternative content.

It uses:

  • An opening tag <noscript>;
  • A closing tag </noscript>.
Warning

This content is displayed only if JavaScript is disabled or not supported.

It is generally used like this:

HTML
<noscript>
  [alternative content]
</noscript>

 

Usage example

Let's take a detailed example:

HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Example of noscript tag</title>
</head>
<body>
    <h1>Welcome to our site</h1>
    <p>For a better experience, make sure JavaScript is enabled.</p>

    <noscript>
      <p>
        <strong>Attention:</strong> JavaScript is disabled or not supported by your browser. Some functionalities will not be available.
      </p>
    </noscript>
</body>
</html>

In this example, the text "Attention..." is only displayed for users who cannot use JavaScript.

 

Attributes

The <noscript> tag does not take any specific attributes; it can use all classic attributes such as: title, class, id, etc.

 

Browser compatibility

BrowserCompatibility with <noscript>
ChromeYes
FirefoxYes
SafariYes
EdgeYes
Internet ExplorerYes

Related terms

Discover our hTML and CSS glossary

Browse the terms and definitions most commonly used in HTML and CSS development.

Share this article

Want to help us? Share this article on your networks or even better: on your site, in an article or in your newsletter.