The HTML <noscript> tag
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
<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?
What can go inside noscript?
Is noscript still useful?
<noscript> filling the gaps.