diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/html/element/output | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/html/element/output')
-rw-r--r-- | files/zh-cn/web/html/element/output/index.html | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/output/index.html b/files/zh-cn/web/html/element/output/index.html new file mode 100644 index 0000000000..7f52d3c694 --- /dev/null +++ b/files/zh-cn/web/html/element/output/index.html @@ -0,0 +1,101 @@ +--- +title: <output> +slug: Web/HTML/Element/output +tags: + - Element + - HTML5 + - Web +translation_of: Web/HTML/Element/output +--- +<p><strong>HTML <code><output></code> 标签</strong>表示计算或用户操作的结果。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row"><a href="/zh-CN/docs/HTML/Content_categories">Content categories</a></th> + <td><a href="/zh-CN/docs/HTML/Content_categories#Flow_content">流式元素</a>,<a href="/zh-CN/docs/HTML/Content_categories#Phrasing_content">短语元素</a>,<a href="/en-US/docs/HTML/Content_categories#Form_listed">listed</a>, <a href="/en-US/docs/HTML/Content_categories#Form_labelable">labelable</a>, <a href="/en-US/docs/HTML/Content_categories#Form_resettable">resettable</a> <a href="/en-US/docs/HTML/Content_categories#Form-associated_content">form-associated element</a>, palpable content.</td> + </tr> + <tr> + <th scope="row">允许元素</th> + <td><a href="/zh-CN/docs/HTML/Content_categories#Phrasing_content">短语元素</a></td> + </tr> + <tr> + <th scope="row">省略标签</th> + <td>{{no_tag_omission}}</td> + </tr> + <tr> + <th scope="row">允许父元素</th> + <td>接受任何 <a href="/zh-CN/docs/HTML/Content_categories#Phrasing_content">短语元素</a></td> + </tr> + <tr> + <th scope="row">允许ARIA角色</th> + <td>Any</td> + </tr> + <tr> + <th scope="row">DOM 接口</th> + <td>{{domxref("HTMLOutputElement")}}</td> + </tr> + </tbody> +</table> + +<h2 id="Attributes" name="Attributes">属性</h2> + +<p><span style="line-height: 21px;">这个标签具有 </span><a href="/zh-CN/docs/HTML/Global_attributes">全局属性</a>。</p> + +<dl> + <dt>{{htmlattrdef("for")}}</dt> + <dd>其它影响计算结果的标签的ID,可以多个。</dd> + <dt>{{htmlattrdef("form")}}</dt> + <dd>与当前标签有关联的form(从属的表单)。该属性的值必须是当前文档内的表单元素的ID。如果未指明该属性,output标签必须是一个form的后代标签。该属性的用处在于可以让output标签脱离form标签,存在于一个网页文档的任意位置。</dd> + <dt>{{htmlattrdef("name")}}</dt> + <dd>name属性。</dd> +</dl> + +<h2 id="Example" name="Example">例子</h2> + +<pre class="brush:html"><form oninput="result.value=parseInt(a.value)+parseInt(b.value)"> + <input type="range" name="b" value="50" /> + + <input type="number" name="a" value="10" /> = + <output name="result"></output> +</form> +</pre> + +<h2 id="Specifications" name="Specifications">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML WHATWG', 'the-button-element.html#the-output-element', '<output>')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C', 'forms.html#the-output-element', '<output>')}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容</h2> + +<div class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div> + +<p>{{Compat("html.elements.output")}}</p> + +<h2 id="See_also" name="See_also">参见</h2> + +<ul> + <li>Other form-related elements: {{HTMLElement("form")}}, {{HTMLElement("input")}}, {{HTMLElement("button")}}, {{HTMLElement("datalist")}}, {{HTMLElement("legend")}}, {{HTMLElement("label")}}, {{HTMLElement("select")}}, {{HTMLElement("optgroup")}}, {{HTMLElement("option")}}, {{HTMLElement("textarea")}}, {{HTMLElement("keygen")}}, {{HTMLElement("fieldset")}}, {{HTMLElement("progress")}} and {{HTMLElement("meter")}}.</li> +</ul> + +<div>{{HTMLRef}}</div> + +<p> </p> |