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

HTML DOM Fieldset name property

Fieldset name property

Fieldset Object Reference Fieldset Object

Example

Return the value of the name property of the fieldset:

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

x The output is:

personalia

Try it »


Definition and Usage

The name property sets or returns the value of the name attribute of the fieldset.

The name property is used to reference form data after form submission, or to reference the element in JavaScript.

**Note:** Only form elements with a name attribute pass their values when the form is submitted.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Except for Internet Explorer and Safari, all other major browsers support the name property.

**Note:** Opera 12 and earlier versions do not support the name property.


Syntax

Return the name attribute:

fieldsetObject

.name

Set the name attribute:

fieldsetObject

.name=

name

Attribute values

Value Description
name Specifies the name of the fieldset.

Technical Details

Return Value: String, representing the name of the fieldset.

More examples

Example

Change the value of the name property of the fieldset:

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

Try it »


Related Articles

HTML Reference Manual:HTML

name attribute


Fieldset Object Reference Fieldset Object