HTML DOM Button オブジェクト
Button オブジェクト
Button オブジェクトは HTML <button> 要素を表します。
Button オブジェクトのアクセス
getElementById() メソッドを使用して <button> 要素にアクセスできます:
var x = document.getElementById("myBtn");
Button オブジェクトの作成
document.createElement() メソッドを使用して <button> 要素を作成できます:
var x = document.createElement("BUTTON");
Button オブジェクトの属性
属性 | 説明 |
---|---|
autofocus | ページが読み込まれたときにボタンが自動的にフォーカスを取得するかどうかを設定または返します。 |
disabled | ボタンが無効化されているかどうかを設定または返します。 |
form | ボタンを含むフォームへの参照を返します。 |
formAction | ボタンの formaction 属性の値を設定または返します。 |
formEnctype | ボタンの formenctype 属性の値を設定または返します。 |
formMethod | ボタンの formmethod 属性の値を設定または返します。 |
formNoValidate | フォームのデータを送信時にバリデーションを行うかどうかを設定または返します。 |
formTarget | ボタンの formtarget 属性の値を設定または返します。 |
name | ボタンの name 属性の値を設定または返します。 |
type | ボタンのタイプを設定または返します。 |
value | ボタンの value 属性の値を設定または返します。 |
関連ページ
HTML 参考マニュアル:HTML <button> タグ