html
  1. html-noscript-tag

HTML <noscript> Tag

The <noscript> tag defines a section of HTML which is displayed if scripting is turned off or not supported in a browser.

Syntax

<noscript>
  <!-- content to be displayed if scripting is turned off or not supported in a browser -->
</noscript>

Example

<p>This paragraph is always visible.</p>
<noscript>
  <p>This paragraph is only visible if JavaScript is turned off or not supported.</p>
</noscript>
Try Playground

If JavaScript is turned on and supported, only "This paragraph is always visible." will be displayed. If JavaScript is turned off or not supported, both "This paragraph is always visible." and "This paragraph is only visible if JavaScript is turned off or not supported." will be displayed.

Explanation

The <noscript> tag is commonly used to provide alternative content to users who have disabled JavaScript in their browser or who are using a browser that does not support JavaScript. This allows the website to remain functional and informative even for users who cannot or choose not to use JavaScript.

Use

  • To provide alternative content for users who have disabled JavaScript
  • To provide alternative content for users who are using a browser that does not support JavaScript

Important Points

  • All content within the <noscript> tag is visible to users who have disabled JavaScript or are using a browser that does not support JavaScript.
  • The <noscript> tag should always be followed by an HTML comment indicating what the alternative content is.

Summary

The <noscript> tag is used to provide alternative content for users who have disabled JavaScript or are using a browser that does not support JavaScript. All content within the <noscript> tag is visible to users who have disabled JavaScript or are using a browser that does not support JavaScript. The <noscript> tag should always be followed by an HTML comment indicating what the alternative content is.

Published on: