Codectionary / Developer documentation / HTML

<noscript>

The <noscript> element defines content to display only when JavaScript is disabled or unsupported in the browser. It commonly contains a message explaining that the page requires JavaScript, or a fallback version of functionality that would otherwise depend on scripting.

Syntax

<noscript>
  <p>This site requires JavaScript to function.</p>
</noscript>

Examples

Basic Warning Message

Informing users that JavaScript is required.

<noscript>
  <p>Please enable JavaScript to use this application.</p>
</noscript>

Fallback Content

Providing a non-JavaScript fallback for an interactive feature.

<div id="live-chart"></div>
<noscript>
  <img src="/static-chart.png" alt="Sales chart (static fallback)">
</noscript>

Styled Notice

A styled banner shown only without JavaScript.

<noscript>
  <div style="background: #fef3c7; padding: 12px; text-align: center;">
    Some features are unavailable with JavaScript disabled.
  </div>
</noscript>

Best practices

  • Use noscript to gracefully inform users rather than leaving them with a blank or broken page
  • Where practical, provide genuine fallback content or functionality, not just a warning message
  • Remember content inside noscript is only rendered when scripting is off — do not rely on it for anything that should also work normally
  • Test your site with JavaScript disabled occasionally to see what your users without it actually experience

At a glance

Purpose
Structure and meaning for web content
File extension
.html · .htm
Runs in
Web browsers
Usually used with
CSS and JavaScript

Specifications & further reading

Related HTML documentation