テキストエリア名プロパティ
例
テキスト領域の名前を取得します。
var x = document.getElementById("myTextarea").name;
定義と使用法
nameプロパティは、テキスト領域のname属性の値を設定または返します。
name属性は、JavaScriptの要素を参照するため、またはフォームの送信後にフォームデータを参照するために使用されます。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
name | Yes | Yes | Yes | Yes | Yes |
構文
nameプロパティを返します。
textareaObject.name
nameプロパティを設定します。
textareaObject.name = text
プロパティ値
Value | Description |
---|---|
text | Specifies the name of the text area |
技術的な詳細
戻り値: | テキスト領域の名前を表す文字列 |
---|
その他の例
例
テキスト領域の名前を変更します。
document.getElementById("myTextarea").name = "newTxtName";
関連ページ
HTMLリファレンス:HTML <textarea> name属性
❮Textareaオブジェクト