w3resource

HTML noscript tag and element

1. HTML noscript element provides an alternate content for user agents don't support execution of the script.

2. HTML noscript element starts with a <noscript> tag and ends with </noscript> tag.

Syntax

<noscript>Text</noscript>

Whether both start and end tags are required

Both start and end tags are required.

Can contain

HTML noscript element can contain all the elements which can reside the body element of an HTML page.

Can reside within

HTML noscript element can reside within all the elements which can reside the body element of an HTML page.

Attributes

Attributes specific to this element

None.

Identifiers

Does not support.

language information and text direction

Does not support.

Title

Does not support.

Style

Does not support.

Events

HTML noscript element does not support event attributes.

Example of using HTML noscript element containing a JavaScript

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example of using HTML noscript element containing a JavaScript</title>
</head>
<body onload="w3r()" >
<script type="text/javascript">
function w3r(){
alert('This is an example of noscript element');
} 

</script>
<noscript><p>If you can see this message, then your browser does not support JavaScript</p></noscript> 
<p>Example of using HTML noscript element containing a JavaScript</p>
</body>
</html>

Result

html noscript element containing a JavaScript

HTML noscript tag example.

Note

Disable JavaScript in your browser, and you will be able to see the text within noscript tags.

For script and noscript elements, theoretically id, class, lang, dir and common event attributes are supported, But in practice, there is no use of it.

Previous: HTML script tag and element
Next: HTML color

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.