Form name attribute

Definition and Usage

name Sets or returns the value of the name attribute of the form.

The HTML name attribute specifies the name of the form.

See also:

HTML Reference Manual:HTML <form> name Attribute

Example

Example 1

Return the form name:

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

Try It Yourself

Example 2

Change the form name:

document.getElementById("myForm").name = "newName";

Try It Yourself

Syntax

Return name attribute:

formObject.name

Set name attribute:

formObject.name = name

Attribute Value

Value Description
name Table Name.

Technical Details

Return Value: A string value that represents the name of the form.

Browser Support

The numbers in the table indicate the first browser version that fully supports this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support