Dofactory.com
Dofactory.com

HTML <noscript> Tag

The <noscript> tag displays its content if JavaScript is not supported. If the browser does support JavaScript, then nothing is displayed.

This tag is placed in either the <head> or <body> element.

Example

#

An example <noscript> tag.  If your browser supports JavaScript then nothing is shown.

<noscript>JavaScript is not supported by your browser.</noscript>

And, this is what you would see if your browser did not support JavaScript.

JavaScript is not supported by your browser.

More Examples

A <noscript> and a <script> tag working together.

If JavaScript is disabled in your browser, it will display the noscript message. If it is enabled it will show the written script content.

<script>
  document.write("Congratulation! JavaScript is supported by your browser.")
</script>

<noscript>Oh no! JavaScript is not supported by your browser.</noscript>

Attributes for <noscript>

The <noscrip> element has no attributes, but it does accept global attributes. The following attribute allows for programmatic access of this element.

Attribute Value Description
id   value Provides the noscript element with a unique identifier.

For additional global attributes see our global attributes list.


Browser support

Here is when <noscript> support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like


Last updated on Sep 30, 2023




Guides