Horje

How to add HTML <fieldset> name Attribute

A <fieldset> with a name attribute.

Definition and Usage

The name attribute specifies a name for a fieldset.

The name attribute is used to reference elements in a JavaScript, or to reference form data after a form is submitted.


Browser Support

Syntax

<fieldset name="text">

Attribute Values

Value Description
name Specifies the name of the fieldset
index.html
Example: HTML
<form action="/action_page.php" method="get">
  <fieldset name="personalia">
    <label for="fname">First name:</label>
    <input type="text" id="fname" name="fname">
  </fieldset>
  <br>
  <button type="button"
  onclick="form.personalia.style.backgroundColor='yellow'">
  Change background color of fieldset</button>
  <input type="submit">
</form> 

Output should be:

How to add HTML <fieldset> name Attribute




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin