Noscript Tag in HTML5

In this article I am going to describe about the implementation and use of Noscript Tag in HTML5
  • 1845

Noscript Tag in HTML5

<noscript> tag means that the browser does not support script. The content present in <noscript> tag will be display when script not support by browser.

The <noscript> tag is available in both HTML5 and HTML4.01. In HTML4.01, the <noscript> tag can be used in body tag. But in HTML5, It can be use in both <head> and <body>.

if scripting is turned off by a mechanism other than the browser, such as a firewall, the fallback content will not appear as expected.

Note : The <noscript> element does nothing, but is used for browsers that recognizes the <script> tag, but does not support the script in it.

Browser Support

It is supported in all major browsers.

Syntax

<noscript> Text or content to be placed</noscript>

Example of <noscript> Tag

<!DOCTYPE html>

 

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>

    <meta charset="utf-8" />

    <title>noscript tag</title>

</head>

<body>

    <h2>Implementation of &lt;noscript&gt; tag in HTML5</h2>

    <script>

        document.write("MCN Solutions!")

    </script>

    <noscript>Sorry, your browser does not support JavaScript!</noscript>

    <p>A browser without support for JavaScript will show the text inside the &lt;noscript&gt; element.</p>

</body>

</html>

Output

noscript.jpg

© 2020 DotNetHeaven. All rights reserved.