HTMLDOM入力リセットオブジェクト
入力リセットオブジェクト
Input Resetオブジェクトは、type = "reset"のHTML <input>要素を表します。
入力リセットオブジェクトにアクセスする
getElementById()を使用して、type = "reset"で<input>要素にアクセスできます。
例
var x = document.getElementById("myReset");
ヒント:フォームの要素コレクションを検索して、<input type = "reset">にアクセスすることもできます。
入力リセットオブジェクトを作成する
document.createElement()メソッドを使用して、type = "reset"で<input>要素を作成できます。
例
var x = document.createElement("INPUT");
x.setAttribute("type", "reset");
入力リセットオブジェクトのプロパティ
Property | Description |
---|---|
autofocus | Sets or returns whether a reset button should automatically get focus when the page loads |
defaultValue | Sets or returns the default value of a reset button |
disabled | Sets or returns whether the reset button is disabled, or not |
form | Returns a reference to the form that contains the reset button |
name | Sets or returns the value of the name attribute of a reset button |
type | Returns which type of form element the reset button is |
value | Sets or returns the value of the value attribute of the reset button |
標準のプロパティとイベント
Input Resetオブジェクトは、標準のプロパティとイベントもサポートします。
関連ページ
HTMLチュートリアル:HTMLフォーム
HTMLリファレンス:HTML <input>タグ
HTML参照:HTML <input>タイプ属性