HTMLButtonElement: type 属性
HTMLButtonElement 接口的 type 属性是一个字符串,表示 <button> 元素的行为类型。
它反映了 <button> 元素的 type 属性。
值
表示类型的字符串。
其可能的值列在该属性的 按钮类型 部分。
示例
HTML
html
<button id="button" type="reset">type</button>
JavaScript
js
const buttonElement = document.querySelector("#button");
console.log(buttonElement.type); // "reset"
规范
| 规范 |
|---|
| HTML # dom-button-type |
浏览器兼容性
加载中…