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

HTML DOM Hidden name property

Hidden name property

Hidden Object Reference Hidden Object


Definition and Usage

The name property sets or returns the value of the name attribute of a hidden field.

The name attribute is used to send data to the server after form submission, or to reference form data in JavaScript.

Note: After form submission, only the name attribute of form elements is used to pass data values.

Syntax

Set the name attribute:

hiddenObject.name="

name

"

Return the name attribute:

hiddenObject.name


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name property.


Example

Example

The following example returns the name of the hidden input field:

Runoob Tutorial(runoob.com)

Try it »


Hidden Object Reference Hidden Object