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/api/htmlfieldsetelement | |
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/api/htmlfieldsetelement')
-rw-r--r-- | files/zh-cn/web/api/htmlfieldsetelement/index.html | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/htmlfieldsetelement/index.html b/files/zh-cn/web/api/htmlfieldsetelement/index.html new file mode 100644 index 0000000000..51b93938c5 --- /dev/null +++ b/files/zh-cn/web/api/htmlfieldsetelement/index.html @@ -0,0 +1,84 @@ +--- +title: HTMLFieldSetElement +slug: Web/API/HTMLFieldSetElement +translation_of: Web/API/HTMLFieldSetElement +--- +<p>{{ ApiRef() }}</p> +<h2 id="HTML_Field_Set_Element">HTML Field Set Element</h2> +<p>DOM <code>fieldset</code> elements expose the <a class="external" href="http://dev.w3.org/html5/spec/forms.html#htmlfieldsetelement" title="http://dev.w3.org/html5/spec/forms.html#htmlfieldsetelement">HTMLFieldSetElement</a> ({{ HTMLVersionInline(4) }} <a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-7365882" title="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-7365882">HTMLFieldSetElement</a>) interface, which provides special properties and methods (beyond the regular <a href="../../../../zh-CN/DOM/element" rel="internal">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of field-set elements.</p> +<h2 id="属性">属性</h2> +<p>以下属性除了 <strong>form</strong> 都是在 {{ HTMLVersionInline(5) }} 中新添加的.</p> +<table class="standard-table"> + <thead> + <tr> + <th scope="col">名称</th> + <th scope="col">类型</th> + <th scope="col">描述</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>disabled</code></td> + <td><code>Boolean</code></td> + <td>读取HTML属性 {{ htmlattrxref("disabled", "fieldset") }},表明用户是否可以操作该控件.</td> + </tr> + <tr> + <td><code>elements</code></td> + <td><code>readonly <a href="/zh-CN/DOM/HTMLFormControlsCollection" title="zh-CN/DOM/HTMLFormControlsCollection">HTMLFormControlsCollection</a></code></td> + <td>The elements belonging to this field set.</td> + </tr> + <tr> + <td><code>form</code></td> + <td><code>readonly <a href="/zh-CN/DOM/HTMLFormElement" title="zh-CN/DOM/HTMLFormElement">HTMLFormElement</a></code></td> + <td>The containing form element, if this element is in a form. Otherwise, the element the <a href="/zh-CN/HTML/Element/fieldset#attr-name" title="zh-CN/HTML/Element/fieldset#attr-name">name content attribute</a> points to {{ HTMLVersionInline(5) }}. (<code>null</code> in {{ HTMLVersionInline(4) }}.)</td> + </tr> + <tr> + <td><code>name</code></td> + <td><code><a href="/zh-CN/DOM/DOMString" title="zh-CN/DOM/DOMString">DOMString</a></code></td> + <td>Reflects the {{ htmlattrxref("name", "fieldset") }} HTML attribute, containing the name of the field set, used for submitting the form.</td> + </tr> + <tr> + <td><code>type</code></td> + <td><code>readonly <a href="/zh-CN/DOM/DOMString" title="zh-CN/DOM/DOMString">DOMString</a></code></td> + <td>一定为字符串<code>fieldset</code>.</td> + </tr> + <tr> + <td><code>validationMessage</code></td> + <td><code>readonly <a href="/zh-CN/DOM/DOMString" title="zh-CN/DOM/DOMString">DOMString</a></code></td> + <td>A localized message that describes the validation constraints that the element does not satisfy (if any). This is the empty string if the element is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.</td> + </tr> + <tr> + <td><code>validity</code></td> + <td><code>readonly <a href="/zh-CN/DOM/ValidityState" title="zh-CN/DOM/ValidityState">ValidityState</a></code></td> + <td>The validity states that this element is in.</td> + </tr> + <tr> + <td><code>willValidate</code></td> + <td><code>boolean</code></td> + <td>Always false because <code>fieldset</code> objects are never candidates for constraint validation.</td> + </tr> + </tbody> +</table> +<h2 id="方法">方法</h2> +<table class="standard-table"> + <thead> + <tr> + <th scope="col">名称 & 参数</th> + <th scope="col">返回值</th> + <th scope="col">描述</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>checkValidity</code>()</td> + <td><code>Boolean</code></td> + <td>如果元素的值没有有效性问题,则返<code>回true</code>,否则返回<code>false</code>并触发<code>invalid</code>事件.</td> + </tr> + <tr> + <td><code>setCustomValidity(in </code><a href="/zh-CN/DOM/DOMString" title="zh-CN/DOM/DOMString">DOMString</a><code> error) </code></td> + <td><code>void</code></td> + <td>设置一个自定义错误,则该元素将无法通过有效性验证.参数指定的字符串就是在向用户报告错误时显示的消息.如果为空字符串,则清除这个自定义错误.</td> + </tr> + </tbody> +</table> +<p> </p> |