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