HTML <noscript> tag

The <noscript> tag is used to provide an alternative message when the browser does not support script (mainly JavaScript).

Type: Block Element (but dependable)

Syntax of <noscript> tag

<noscript>
  Alternative Message
</noscript>

Full code example

<!DOCTYPE html>
<html>
<head>
</head>
<body>

  <script>
    alert("Hello World!");
  </script>

  <noscript>
    <p>Your browser does not support JavaScript!</p>
  </noscript>

</body>
</html>

Run The code »
If your browers does not support or has disabled JavaScript, the content inside the <noscript> element will be displayed; otherwise the alert box “Hello World!” will appear.

Supported Browsers

Tag Chrome Internet Explorer Firefox Safari Opera Mini
<noscript> Yes Yes Yes Yes Yes

More reference

If your browser does not support scripting (mainly JavaScript) or if JavaScript is disabled, the text inside the <noscript> and </noscript> tags will be displayed in the active web browser. If the browser supports scripting, the <noscript> content will not be shown.

In HTML 4.01, there was a strict rule that the position of the <noscript> element must be inside the <head> element only. In HTML5, this rule changed. This tag can now be placed in either the <head> section or the <body> section (with content restrictions in <head>).

In XHTML, the <noscript> element is not supported.