大网数据广告活动
Web 标准与前端开发

HTMLFieldSetElement

· 52CE 我爱测

DOM `fieldset` elements expose the HTMLFieldSetElement (HTMLFieldSetElement) interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of fiel

HTML Field Set Element

DOM fieldset elements expose the HTMLFieldSetElement (HTMLFieldSetElement) interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of field-set elements.

属性

属性继承自其父级 HTMLElement。

名称 类型 描述
disabled Boolean 读取 HTML 属性 disabled,表明用户是否可以操作该控件。
elements readonly HTMLFormControlsCollection The elements belonging to this field set.
form An HTMLFormControlsCollection or HTMLCollection referencing the containing form element, if this element is in a form. If the field set is not a descendant of a form element, then the attribute can be the ID of any form element in the same document it is related to, or the null value if none matches.
name DOMString Reflects the name HTML attribute, containing the name of the field set, used for submitting the form.
type readonly DOMString 一定为字符串fieldset.
validationMessage readonly DOMString 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 (willValidate is false), or it satisfies its constraints.
validity readonly ValidityState The validity states that this element is in.
willValidate boolean Always false because fieldset objects are never candidates for constraint validation.

方法

名称 & 参数 返回值 描述
checkValidity() Boolean 如果元素的值没有有效性问题,则返回 true,否则返回 false 并触发 invalid 事件。
setCustomValidity(in DOMString error) void 设置一个自定义错误,则该元素将无法通过有效性验证。参数指定的字符串就是在向用户报告错误时显示的消息。如果为空字符串,则清除这个自定义错误。

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。