Latest web development tutorials

HTML input form attributes

HTML input Tag Reference HTML <input> tag

Examples

Form form input fields located outside (but still belongs to form part of the form):

<form action="demo-form.php" id="form1">
First name: <input type="text" name="fname"><br>
<input type="submit" value="提交">
</form>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

In addition to Internet Explorer, almost all of the major browsers support form property.


Definition and Usage

form attribute specifies <input> elements in the form of one or more belongs.


Differences between HTML 4.01 and HTML5

form attribute is new in HTML5 attributes.


grammar

<input form=" form_id ">

Property Value

描述
form_id 规定 <input> 元素所属的一个或多个表单的 id 列表,以空格分隔。


HTML input Tag Reference HTML <input> tag