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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <button> form Attribut

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.

 HTML <button> Tag

Online-Beispiel

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 ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Except for the Internet Explorer browser, all other mainstream browsers support the form attribute.

Definition and usage

The form attribute specifies one or more forms to which the button belongs.

HTML 4.01 with HTML5difference

The form attribute is an HTML5new attribute.

Syntax

<button form="form_id">

Attribute value

ValueDescription
form_idID of the form to which the button belongs. To reference more than one form, use a space-separated list.
 HTML <button> Tag