English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML: <fieldset> name attribute

The HTML fieldset name attribute specifies the name of the fieldset, the name attribute is used to reference elements in JavaScript, or to reference form data after submitting the form.

 HTML <fieldset> tag

Online Example

A <fieldset> with a name attribute:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML <fieldset> name 属性使用-基础教程(oldtoolbag.com)</title>
body>/head>
<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>
body>/fieldset>
<button type="button" onclick="form.personalia.style.backgroundColor='yellow'yellow&#/">Change background color of fieldset<
button>
body>/<input type="submit">
body>/form>
body>/<
html>/Test to see ‹

Browser CompatibilityIEFirefoxOperaChrome

Safari

In addition to Internet Explorer, other mainstream browsers support the name attribute.

Definition and Usage

The name attribute specifies the name of the fieldset.

The name attribute is used to reference elements in JavaScript, or to reference form data after submitting the form. 4HTML1 .05is with HTML

The difference between the attribute and the <fieldset> tag in HTML5 of the new attribute.

Syntax

<fieldset name="text">

Attribute Value

ValueDescription
nameSpecifies the name of the fieldset.
 HTML <fieldset> tag