HTML <noscript> Element

The HTML <noscript> element provides alternative content for users whose browsers do not support scripting or have scripting disabled.

Syntax

<noscript>
  <p>JavaScript is disabled or unavailable.</p>
</noscript>

The <noscript> element requires both an opening and closing tag. Its contents are shown only when scripting is disabled or unsupported.

Attributes

The <noscript> element supports the global HTML attributes. It does not have any element-specific attributes.

Example

This example displays a message inside the <noscript> element when JavaScript is not available.

Play in Editor

Usage Notes

Use the <noscript> element when important information or an alternative experience should be available if scripting cannot run.

The element can be used in the document body to provide visible fallback content, such as instructions, warnings, or alternative links.

When placed inside the <head>, the permitted content is more limited and may include elements such as <link>, <style>, and <meta>.

Do not use <noscript> as a replacement for making essential page content available without JavaScript when possible. Important content and navigation should remain usable even when scripts fail or are unavailable.

Accessibility

Fallback content inside <noscript> should clearly explain what functionality is unavailable and provide an alternative when possible.

Avoid vague messages such as "JavaScript required" without additional guidance. If a feature cannot function without scripting, explain what the user can do instead or provide a direct link to an alternative page or resource.

Browser Support

Baseline: Widely available indicates a feature has been supported by core browsers for at least 30 months. At this stage, the feature is considered stable and safe for most websites to use without needing to worry about compatibility issues or fallbacks, as it is supported by the vast majority of users' devices and browser versions.

For detailed browser compatibility information, see Can I Use: HTML <noscript> Element .

The <noscript> element is closely related to the <script> element, which embeds or references executable scripts, and the <head> and <body> elements, where <noscript> can be used in different contexts.

Specifications

HTML Living Standard: The <noscript> Element