<noscript>

HTML <noscript> Tag

The <noscript> tag has an alternative content displayed in the browsers not supporting scripts, or the browsers, where the user disables the script support. Otherwise, the browser ignores this tag and its content.

In HTML5 the <noscript> tag can be placed in the <head> and <body> elements. In HTML4 it can be used only in the <body> element. If the <noscript> is placed in the <head> tag, it must contain only the <link>, <style> and <meta> tags.

You can use the comment tag to “hide” scripts from browsers not supporting client-side scripts. (>您可以使用注释标签对不支持客户端脚本的浏览器“隐藏”脚本。)

Syntax

Syntax (语法)

The <noscript> tag comes in pairs. The content is written between the opening (<noscript>) and closing (</noscript>) tags.

Example of the HTML <noscript> tag:

<!DOCTYPE html>
<html>
 <head>
   <title>Title of the document</title>
 </head>
 <body>
   <script>
     document.write("My first code in JavaScript!")
(document.write ("我的第一个JavaScript代码!"))
   </script>
   <noscript>Sorry, your Browser doesn’t support JavaScript!</noscript>
 </body>
</html>

Result

Attributes

Attributes (属性)

The <noscript> tag supports the Global Attributes and the Event Attributes.



请遵守《互联网环境法规》文明发言,欢迎讨论问题
扫码反馈

扫一扫,反馈当前页面

咨询反馈
扫码关注
返回顶部