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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <input> form Attribute

Die Form-Attribute spezifizieren das Formular, dem der <input>-Element zugeordnet ist. Ein oder mehrere Formulare, den der <input>-Element zugeordnet ist

 HTML <input> Tag

Online-Beispiel

Ein Input-Feld, das sich außerhalb des HTML-Formulars befindet (aber dennoch ein Teil desselben ist):

<!DOCTYPE html>
<html>
<head>
<title>HTML:<input> form Attribute - 基础教程网(oldtoolbag.com)</title>
<body>
<form action="action_page.php" id="form1">
First name: <input type="text" name="fname"><br>
<input type="submit" value="Submit">
</form>
<p>The "surname" field in <p> is outside the form element, but it is still part of the form.</>
Last name: <input type="text" name="lname" form="form1">
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Almost all mainstream browsers support the form attribute, except for Internet Explorer.

Definition and Usage

The form attribute specifies one or more forms to which the <input> element belongs.

HTML 4.01 and HTML5differences between

The form attribute in HTML5 new attribute added in.

Syntax

<input form="form_id">

Attribute Value

ValueDescription
form_idSpecify a list of one or more forms to which the <input> element belongs, separated by spaces.
 HTML <input> Tag