English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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
Definition and Usage
The name attribute specifies the name of the fieldset.
The difference between the attribute and the <fieldset> tag in HTML5 of the new attribute.
<fieldset name="text">
Value | Description |
---|---|
name | Specifies the name of the fieldset. |