Latest web development tutorials

HTML DOM Checkbox objects

Checkbox objects

Checkbox object represents an HTML form in a selection box.

HTML document <input type = "checkbox"> Every once, Checkbox object is created.

You can traverse the form elements [] array to access a selection box, or by using document.getElementById ().


Checkbox object properties

W3C: W3C standards.

属性 描述 W3C
disabled 设置或返回 checkbox 是否应被禁用。 Yes
checked 设置或返回 checkbox 是否应被选中。 Yes
defaultChecked 返回 checked 属性的默认值。 Yes
form 返回对包含 checkbox 的表单的引用。 Yes
name 设置或返回 checkbox 的名称。 Yes
type 返回 checkbox 的表单元素类型。 Yes
value 设置或返回 checkbox 的 value 属性的值 Yes

Standard properties and events

Checkbox object also supports the standard attributes and events .