Textareavalueプロパティ_
例
テキスト領域の内容を変更します。
document.getElementById("myTextarea").value = "Fifth Avenue, New York City";
定義と使用法
valueプロパティは、テキスト領域の内容を設定または返します。
注:テキスト領域の値は、<textarea>タグと</ textarea>タグの間のテキストです。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
value | Yes | Yes | Yes | Yes | Yes |
構文
valueプロパティを返します。
textareaObject.value
valueプロパティを設定します。
textareaObject.value = text
プロパティ値
Value | Description |
---|---|
text | Specifies the value (contents) of the text area |
技術的な詳細
戻り値: | テキスト領域のコンテンツ/テキストを表す文字列 |
---|
その他の例
例
テキスト領域のコンテンツを取得します。
var x = document.getElementById("myTextarea").value;
❮Textareaオブジェクト