Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

HTMLFormElement.name

概要

form の name 属性は、その form 要素の名前を文字列として返します。

構文

string = form.name; //取得
form.name = string; //設定

var form1_Name = document.getElementById("form1").name;

if (form1_Name != document.form.name) {
   // browser doesn't support this form of reference
}

注意

この属性は読み書きともに可能であり、フォーム名の読取り及び設定に使用できます。

もしフォーム内に "name" と名付けられた要素を含めてしまった場合、その要素が優先され、name 属性でのフォームオーナーへのアクセスが出来なくなってしまいます。

Internet Explorer (IE) では、createElement() メソッドによって作成された要素に対する name 属性を用いての名前の設定 / 書換は許可されていません。

仕様書

ドキュメントのタグと貢献者

タグ: 
 このページの貢献者: fscholz, ethertank
 最終更新者: ethertank,