HTML DOM Fieldset name attribute
Examples
Back fieldset name attribute values:
var x = document.getElementById("myFieldset").name;
x The output is:
personalia
try it"
Definition and Usage
name property sets or returns the value of the name attribute of the fieldset.
name attribute is used to reference the data in a form after form submission or reference elements in JavaScript.
Note: Only form element with name attribute transfer their values when the form is submitted.
Browser Support
In addition to Internet Explorer and Safari, the other major browsers support name attribute.
Note: Opera version 12 and earlier does not support name attribute.
grammar
Returns the name attribute:
fieldsetObject .name
Setting name attribute:
fieldsetObject .name= name
Property Value
值 | 描述 |
---|---|
name | 指定 fieldset 的名称。 |
technical details
return value: | A string representing the name of the fieldset. |
---|
More examples
Examples
Fieldset change the value of the name attribute:
document.getElementById("myFieldset").name="newName";
try it"
related articles
HTML Reference Manual: HTML <fieldset> name attribute