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