HTML <noscript> Tag

The <noscript> tag defines a section of html which should be inserted if a script type on the page is not supported or if scripting is currently turned off in the browser.

When you put a content inside <noscript> element, it will be displayed if scripts are not supported, or are disabled in the user's browser.

In HTML5 the <noscript> element can be used in both <head> and <body> elements. While in HTML4 it can be used only in <body> element.

When it is used inside the <head> tag, it must contain <link>, <style>, and <meta> elements.

Syntax

The <noscript> tag comes in pairs. The content must be written between opening (<noscript>) and closing (</noscript>) tags.

Example

<!DOCTYPE html>
<html>
   <body>
      <script>
         document.write("My first JavaScript example!")
      </script>
      <noscript>Sorry, your browser does not support JavaScript!</noscript>
      <p>A browser without support for JavaScript will show the text inside the noscript element.</p>
   </body>
</html>

Result


My first JavaScript example!

A browser without support for JavaScript will show the text inside the noscript element.


The <noscript> element also supports the Global Attributes.