HTML noscript Tag

Beginner
6 min read
Updated: Oct 2026
4 examples
Live preview

Definition and Usage

The <noscript> element holds fallback HTML for when scripting is turned off or unsupported in the browser. Pair it with <script> pages that need a non-JS path.

With scripting off, the browser shows the children as HTML. With scripting on, that fallback is not presented as page content (MDN: children are treated as text). Prefer progressive enhancement: put core content in HTML first, then enhance with script.

Baseline · Widely available.

Not deprecated. Stable across browsers since about July 2015 (and much earlier in practice).

Study note.

On this tutorial site, JavaScript is enabled, so a real <noscript> block stays hidden. Previews below simulate scripting on vs off.

HTML Syntax

syntax.html
<noscript>
  fallback content
</noscript>

Both start and end tags are required. No nested <noscript>. In <head>, children are limited to <link>, <style>, and <meta> (when scripting is off).

Attributes

The <noscript> element has no element-specific attributes — only global attributes.

AttributeDescriptionNotes
None specificNo dedicated attributes on <noscript>.Use class / id if you need to style the fallback.

Global Attributes

The <noscript> tag also supports the Global Attributes in HTML.

Live Preview

Simulate scripting on vs off. Real browser behavior matches this idea; this widget is a teaching preview.

Fallback HTML appears only when scripting is off.

Page preview

Rocks! (always visible)

Scripting on — noscript fallback hidden

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor. View Output shows the JS-off appearance for study.

Example 1 — Fallback Message in the Body

Tell visitors that JavaScript is required when it is off.

HTML
<noscript>
  <p>Please enable JavaScript to use this page.</p>
</noscript>
<p>Welcome to the app.</p>
Try It Yourself

How It Works

  1. Wrap the fallback in <noscript>…</noscript>.
  2. Keep normal page content outside so it still shows when JS is on.
  3. When JS is off, the browser displays the message inside noscript.
  4. When JS is on, that message is not shown as page content.

Example 3 — Fallback Stylesheet in head

Inside <head>, noscript may load a stylesheet when JS is off.

HTML
<head>
  <meta charset="UTF-8">
  <title>App</title>
  <noscript>
    <link rel="stylesheet" href="no-js.css">
  </noscript>
</head>
Try It Yourself

How It Works

  1. Place noscript in <head> next to other metadata.
  2. Allow only link, style, or meta inside that head noscript.
  3. When scripting is off, the stylesheet (or meta) applies.
  4. When scripting is on, that head fallback is not used as active markup.

Example 4 — Script Plus Fallback

Enhance with script; keep a clear path if script never runs.

HTML
<button type="button" id="save">Save draft</button>

<noscript>
  <p>Saving needs JavaScript. Use the
    <a href="/export.txt">downloadable export</a> instead.
  </p>
</noscript>

<script>
  document.getElementById("save").addEventListener("click", function () {
    alert("Draft saved (demo).");
  });
</script>
Try It Yourself

How It Works

  1. Provide the control in HTML (<button>).
  2. Add behavior with <script> for users who have JS.
  3. Add noscript with a non-JS alternative (download link).
  4. Do not hide the only useful content inside script alone.

Edge Cases & Pitfalls

Most noscript mistakes assume it always shows, or put the wrong content in head.

visibility

Hidden when JS is on

Modern browsers enable scripting by default, so you will not see noscript content during normal browsing.

nesting

No nested noscript

Do not put <noscript> inside another <noscript>. Keep one clear fallback block.

head

Limited children in head

In <head>, only link, style, and meta belong inside noscript when scripting is off.

design

Not a full a11y strategy

Most assistive-tech users have JavaScript on. Build usable HTML first; use noscript as an extra safety net.

seo

Do not hide main content

Put important copy in normal HTML. Using noscript only to stash primary content is a poor pattern for users and crawlers.

Browser Support

The <noscript> element is core HTML in every browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<noscript>

Widely available since about July 2015 (and long before). Browsers show its children when scripting is disabled or unsupported.

98% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer All
Supported
noscript Widely supported

Bottom line: Safe to use. Prefer progressive enhancement; keep noscript as a clear non-JS fallback.

Key Takeaways

  • Purpose: fallback HTML when scripting is off or unsupported.
  • Placement: body for messages/links; head for link/style/meta.
  • Rules: both tags required; never nest noscript.
  • Design: enhance with script; do not hide core content only in JS.

One line: use noscript for a real non-JS path, not as the only place important content lives.

Default CSS Settings

Typical user-agent defaults (exact values vary by browser):

default.css
noscript {
  display: block; /* when shown in body as flow content */
}

/* When scripting is enabled, browsers do not present
   noscript children as normal page content */

Style the fallback with normal CSS when it is visible (scripting off).

Frequently Asked Questions

The noscript element holds HTML that the browser shows when scripting is turned off or unsupported. When scripting is on, that fallback is not shown as page content.
In the body for messages and links, or in the head for link, style, and meta only. Do not nest noscript inside another noscript.
Usually no — scripting is enabled by default, so the fallback stays hidden. Disable JavaScript in browser settings (or use a simulated preview) to see it.
It helps people with scripting off, but most users need a usable page with scripting on. Prefer progressive enhancement: core content in HTML, then enhance with script.
Yes. Inside head, when scripting is off, it may contain link, style, and meta elements — useful for fallback stylesheets.
No. It only supports the global attributes.

Next: object

Embed external resources with the HTML object element and its fallback content.

object tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful