English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Dieser Artikel beschreibt die Verwendung des HTML-Button-Form-Attributs, zeigt Beispiele zur Verwendung des HTML-Button-Form-Attributs, die Kompatibilität der Browser, die Syntaxdefinition und detaillierte Informationen zu seinen Attributswerten.
Knöpfe, die sich außerhalb des Formulars befinden (aber dennoch Teil desselben sind):
<!DOCTYPE html> <html> <head> <title>HTML: <button> form Attribute - 基础教程网 oldtoolbag.com</title> <body> <form action="demo-form.php" method="get" id="form1"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> </form> <p>The button below is outside the form element but is still part of the form.</p> <button type="submit" form="form1" value="submit">submit</button> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
Except for the Internet Explorer browser, all other mainstream browsers support the form attribute.
The form attribute specifies one or more forms to which the button belongs.
The form attribute is an HTML5new attribute.
<button form="form_id">
Value | Description |
---|---|
form_id | ID of the form to which the button belongs. To reference more than one form, use a space-separated list. |