<noscript>

概要

如果页面上的脚本类型不受支持或者当前在浏览器中关闭了脚本,则HTML <noscript>元素定义要插入的html部分。

内容分类 Metadata content, flow content, phrasing content.
允许的内容 When scripting is disabled and when it is a descendant of the <head> element: in any order, zero or more <link> elements, zero or more <style> elements, and zero or more <meta> elements.
When scripting is disabled and when it isn't a descendant of the <head> element: any transparent content, but no <noscript> element must be among its descendants.
Otherwise: flow content or phrasing content.
标签省略 不允许,开始标签和结束标签都不能省略。
允许的父元素 Any element that accepts phrasing content, if there are no ancestor <noscript> element, or in a <head> element (but only for an HTML document), here again if there are no ancestor <noscript> element.
DOM接口 HTMLElement

属性

This element only includes the global attributes.

例子

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

Result with scripting enabled

Rocks!

Result with scripting disabled

External Link

Rocks!

Specifications

Specification Status Comment
WHATWG HTML Living Standard
<noscript>
Living Standard  
HTML5
<noscript>
Recommendation  
HTML 4.01 Specification
<noscript>
Recommendation  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)

文档标签和贡献者