X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Textarea name Property

Textarea Object Reference Textarea Object

Example

Get the name of a text area:

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

The result of x will be:

comment

Try it yourself »


Definition and Usage

The name property sets or returns the value of the name attribute of a text area.

The name attribute is used to reference elements in a JavaScript, or to reference form data after a form is submitted.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The name property is supported in all major browsers.


Syntax

Return the name property:

textareaObject.name

Set the name property:

textareaObject.name=text

Property Values

Value Description
text Specifies the name of the text area

Technical Details

Return Value: A String, representing the name of the text area


More Examples

Example

Change the name of a text area:

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

Try it yourself »


Related Pages

HTML reference: HTML <textarea> name attribute


Textarea Object Reference Textarea Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook