noscript

The HTML <noscript> element provides alternative content when JavaScript is disabled or unavailable. Use it to keep an important message or route usable without scripts.

What you will learn

Basic body example

<main>
  <h1>Product catalog</h1>
  <noscript>
    <p>JavaScript is required for filters. <a href="products/">Browse the full catalog</a>.</p>
  </noscript>
</main>

When scripting is disabled, the content inside noscript is parsed and shown. When scripting is enabled, it is not shown as ordinary body content.

Head form

<head>
  <noscript>
    <meta http-equiv="refresh" content="0; url=/no-javascript.html">
  </noscript>
</head>

Inside head, only content allowed in the document head is appropriate. Do not put ordinary paragraphs there. A redirect or other metadata fallback must be used carefully so it does not create loops or surprise users.

Do not hide the real content behind JavaScript

A fallback is useful, but the stronger design is to make essential content and navigation work without JavaScript whenever practical. Use scripts to enhance the experience, not to make every basic task impossible.

Common mistakes

Related pages