fieldset name Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:fieldset

Description

The name attribute sets 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.

Attribute Values

Value Description
name Specifies the name of the fieldset

A <fieldset> with a name attribute:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php" method="get">
<fieldset name="personalia">
  Name: <input type="text" name="username"><br>
  Email: <input type="text" name="usermail"><br>
</fieldset>
<button type="button" onclick="form.personalia.style.backgroundColor='yellow'">Change background color of fieldset</button>
<input type="submit">
</form><!--from   ww w .j av a 2  s.c om-->

</body>
</html>

Related Tutorials