Latest web development tutorials

HTML DOM Button objects

Button Objects

Button object represents an HTML document of a button.

This element has no default behavior, but there must be an onclick event handler to use.

HTML document <input type = "button"> tag appears every time a Button object is created.

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


Button Object Properties

W3C: W3C standards.

属性 描述 W3C
disabled 设置或返回是否禁用按钮。 Yes
form 返回对包含该按钮的表单对象的引用。 Yes
name 设置或返回按钮的名称。 Yes
type 返回按钮的表单元素类型。 Yes
value 设置或返回在按钮上显示的文本。 Yes

Standard properties and events

Button object also supports the standard attributes and events .