Textarea nameProperty

Textarea 对象参考手册Textarea Object


Examples

Get the name of the textarea:

var x = document.getElementById("myTextarea").name;

Try it Yourself »

Definition and Usage

The name attribute sets or returns the name of a textarea.



Browser Support

Property
name Yes Yes Yes Yes Yes

Syntax

Set the name attribute:

textareaObject.name = text

Return the name attribute:

textareaObject.name

Tip:The name attribute has no default value.



Property Values

Value Description
text The name of the specified textarea


Technical Details

Return value: A string, representing the name of the textarea.

More Examples

Example

Change the name of the textarea:

document.getElementById("myTextarea").name = "newTxtName";

Try it Yourself »


Textarea 对象参考手册Textarea Object

Other Extensions