HTML - <noscript> Tag



HTML <noscript> tag is used to define alternate content if the browser is not supporting JavaScript or the user disabled the JavaScript.

The <noscript> tag in HTML5 can be inserted into the <head> and <body> elements. It can only be applied to the <body> element in HTML4. If the <noscript> tag is placed in the <head> tag it must contain the <link>, <style>, and <meta> tags.

Syntax

<noscript> ... </noscript>

Attribute

HTML noscript tag supports only Global Attributes

Examples of HTML noscript Tag

Bellow examples will illustrate the usage of noscript tag. Where, when and how to use noscript tag.

Implementing noscript Element

Let’s look at a basic example of the usage of the <noscript> tag. On running the above code, it will generate an output consisting of the <script> tag text displayed on the webpage. As our browser supports scripting, it displayed the <script> tag text instead of the <noscript> tag text.

<!DOCTYPE html>
<html>

<head>
    <title>HTML noscript Tag</title>
</head>

<body>
    <script type="text/JavaScript"> 
        document.write("Hello JavaScript!")
    </script>
    <noscript>
        Your browser does not support JavaScript!
    </noscript>
</body>

</html>

Supported Browsers

Tag Chrome Edge Firefox Safari Opera
noscript Yes Yes Yes Yes Yes
html_tags_reference.htm
Advertisements