<fieldset>


HTML DOM Fieldset object


Fieldset object

A Fieldset object represents an HTML <fieldset> element.

Access Fieldset objects

You can use getElementById() to access the <fieldset> element:

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

Try It! 

Tip: You can also access Fieldset objects by searching the form's elements collection.

Create Fieldset object

You can use the document.createElement() method to create <fieldset> elements:

var x = document.createElement("myFieldset");

Try It! 

Fieldset object properties

Attribute added in HTML5.image.png

AttributeDescription
disabledimage.pngSets or returns whether fieldset is disabled.
formimage.pngReturns a reference to a form that contains fieldsets.
nameimage.pngSets or returns the value of the name property of the fieldset.
typeReturns which type of form element fieldset is.

Standard Properties and Events

Fieldset objects also support standard properties and events .


Related articles

HTML Tutorial: HTML Forms

HTML Reference Manual: HTML <fieldset> Tag