Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Textarea name property

Textarea name property

Textarea Object Reference The Textarea object


Example

Get the name of the textarea:

var

x

=

document

.

getElementById

(

"

myTextarea

"

)

.

name

;

Try it »

Definition and Usage

The name property sets or returns the name of the textarea.


Browser support

property
name Yes Yes Yes Yes Yes

Syntax

Set the name attribute:

textareaObject.name = text

Return the name attribute:

textareaObject.name

**Note:** The name property has no default value.


Attribute values

Value Description
text Specifies the name of the textarea

Technical Details

Return value: String, representing the name of the textarea text box.

More examples

Example

Modify the name of the textarea text box:

document

.

getElementById

(

"

myTextarea

"

)

.

name

=

"

newTxtName

"

;

Try it »


Textarea Object Reference The Textarea object