<noscript>

如果页面上的脚本类型不受支持或者当前在浏览器中关闭了脚本,则在 HTML <noscript> 元素中定义脚本未被执行时的替代内容。

内容分类 (en-US) Metadata content (en-US), flow content (en-US), phrasing content (en-US).
允许的内容

当脚本被禁用并且它是 <head>元素的后代时:以下顺序任意,零个或者多个<link>元素,零个或者多个<style>元素,零个或者多个<meta>元素。

当脚本被禁用并且它不是 <head> 元素的子元素时:任何 transparent content 都可以,但是在它的后代中必须没有 <noscript>元素。

否则:flow content 或 phrasing content。

标签省略

不允许,开始标签和结束标签都不能省略。

允许的父元素

如果没有根元素 <noscript>,或者在<head>元素中(仅用于 HTML 文档)也没有根元素 <noscript>,允许任何 phrasing content (en-US) 元素。

DOM 接口 HTMLElement

属性

该元素只包含 全局属性 (en-US).

示例

html
<noscript>
  <!-- anchor linking to external file -->
  <a href="http://www.mozilla.com/">External Link</a>
</noscript>
<p>Rocks!</p>

允许脚本时的结果

Rocks!

禁用脚本时的结果

规范

Specification
HTML Standard
# the-noscript-element

浏览器兼容性

BCD tables only load in the browser