totn HTML

HTML: <noscript> tag

This HTML tutorial explains how to use the HTML element called the <noscript> tag with syntax and examples.

Description

The HTML <noscript> tag defines alternate HTML to be inserted if a script type is not supported or if the browser has disabled scripting. This tag is also commonly referred to as the <noscript> element.

Syntax

In HTML, the syntax for the <noscript> tag is: (example that shows a paragraph that would appear if the script type is not supported or the browser has disabled scripting)

<noscript>
  <p>This is a <a href="examples.html">link to more examples</a>.</p>
</noscript>

Attributes

Only the Global Attributes apply to the <noscript> tag. There are no attributes that are specific to the <noscript> tag.

Note

  • The HTML <noscript> element is found either within the <head> tag or the <body> tag.
  • The <noscript> tag will display alternate HTML content if the script type is not supported or if the browser has scripting disabled.
  • If the scripting is enabled on the browser, the <noscript> tag will not display content on the page.
  • See also <script> tag.

Browser Compatibility

The <noscript> tag has basic support with the following browsers:

  • Chrome
  • Android
  • Firefox (Gecko)
  • Firefox Mobile (Gecko)
  • Internet Explorer (IE)
  • Edge Mobile
  • Opera
  • Opera Mobile
  • Safari (WebKit)
  • Safari Mobile

Example

We will discuss the <noscript> tag below, exploring examples of how to use the <noscript> tag in HTML5, HTML 4.01 Transitional, XHTML 1.0 Transitional, XHTML 1.0 Strict, and XHTML 1.1.