HTML <fieldset> name Attribute

❮ HTML <fieldset> tag


<form action="action.php" method="get">
  <fieldset name="userinfo">
    <legend>User Info:</legend>
    <label for="fname">First name:</label>
    <input type="text" id="fname" name="fname">
  <button type="button" onclick="'tomato'"> Change background color of fieldset</button>
  <input type="submit" value="submit">


This attribute specifies a name for a <fieldset>.

This attribute is used to reference elements in a JavaScript.

This attribute is used to reference form data after a form is submitted.

The caption for the fieldset is given by the first <legend> element nested inside it.

Note: It can be used for JavaScript interaction.

Standard Syntax

<fieldset name="text">...</fieldset>

Browser Support


Attribute Values

Value Description
text The name of the fieldset
❮ HTML <fieldset> tag