HTML DOM Button 物件
Button 物件
Button 物件代表一個 HTML <button> 元素。
訪問 Button 物件
您可以使用 getElementById() 來訪問 <button> 元素。
建立 Button 物件
您可以使用 document.createElement() 方法來建立 <button> 元素。
Button 物件屬性
屬性 | 描述 |
---|---|
autofocus | 設定或返回當頁面載入時按鈕是否應自動獲得焦點。 |
disabled | 設定或返回按鈕是否被停用。 |
form | 返回包含按鈕的表單的引用。 |
formAction | 設定或返回按鈕 formaction 屬性的值。 |
formEnctype | 設定或返回按鈕 formenctype 屬性的值。 |
formMethod | 設定或返回按鈕 formmethod 屬性的值。 |
formNoValidate | 設定或返回提交時是否應驗證表單資料 |
formTarget | 設定或返回按鈕 formtarget 屬性的值。 |
name | 設定或返回按鈕 name 屬性的值。 |
type | 設定或返回按鈕的型別。 |
value | 設定或返回按鈕 value 屬性的值。 |
標準屬性和事件
相關頁面
HTML 參考:HTML <button> 標籤