References

Beginner-friendly references for web development, with live, editable examples.

The HTML <noscript> tag

Element All modern browsers Updated
Quick answer

The HTML <noscript> element displays content only when scripts are disabled or unsupported. Use it to provide a fallback message or essential markup for users without JavaScript.

Overview

The <noscript> element holds content that is shown only when JavaScript is unavailable — disabled, blocked, or failed to load. It is your fallback for the minority of visits where scripting does not run.

Where it can sit depends on context: inside the <body> it can contain any flow content (a message, a static alternative), while inside the <head> it may only contain metadata-style elements like <link> and <style>.

The stronger strategy, though, is progressive enhancement: build a baseline that works without JavaScript, then layer scripting on top. Used that way, <noscript> becomes a small safety net for the few places scripting is genuinely required, rather than a crutch for a script-only site.

Syntax

<noscript>This site works best with JavaScript enabled.</noscript>

Example

Live example
<noscript><p>Please enable JavaScript to use the interactive demo.</p></noscript>

Best practices

  • Build a working baseline that does not require JavaScript (progressive enhancement).
  • Use <noscript> sparingly, to fill genuine gaps where scripting is required.
  • In the body it holds flow content; in the head, only metadata elements.
  • Provide a clear, helpful message rather than a generic "enable JavaScript" notice.

Frequently asked questions

What is the noscript element?
It contains fallback content shown only when JavaScript is unavailable.
What can go inside noscript?
In the <body>, any flow content; in the <head>, only metadata elements like <link> and <style>.
Is noscript still useful?
Yes, as a small safety net. The better strategy is progressive enhancement — a baseline that works without JavaScript — with <noscript> filling the gaps.
Can noscript go in the head?
Yes, but there it may only contain metadata-style elements such as <link> and <style>.