4 HTML5中form表单的新增属性
在创建Web应用时,会用到大量的表单元素,HTML5中为表单增加了很多诱人的属性,强化了表单元素的功能,使得关于表单的编写更快、更方便。
<meta charset="utf-8">
<form id="login" action="login.php" method="get">
</form>
<input form="login" list="listtest" autofocus autocomplete="off" type="text" name="username"> <br>
<input form="login" placeholder="please input value!" type="text" name="username"> <br>
<input form="login" formaction="one.php" formmethod="get" type="submit" name="dosubmit" value="删除"><br>
<input form="login" formaction="two.php" formmethod="post" type="submit" name="dosubmit" value="通过"><br>
<input form="login" formaction="three.php" formmethod="get" type="submit" name="dosubmit" value="不通过"><br>
<datalist id="listtest">
<option>this is one</option>
<option>this is two</option>
<option>this is three</option>
<option>this is four</option>
</datalist>
from.html
<meta charset="utf-8">
<form id="login" action="login.php" method="get">
</form>
<input form="login" type="text" name="username" value="admin"> <br>
<input form="login" type="submit" name="dosubmit" value="登录">
<form id="login1" action="login1.php" method="get">
</form>
<input form="login1" type="text" name="username" value="admin"> <br>
<input form="login1" type="submit" name="dosubmit" value="登录">
from1.html
<meta charset="utf-8">
<form id="login" action="login.php" method="get">
</form>
<input form="login" type="text" name="username" value="admin"> <br>
<input form="login" formaction="one.php" formmethod="get" type="submit" name="dosubmit" value="删除"><br>
<input form="login" formaction="two.php" formmethod="post" type="submit" name="dosubmit" value="通过"><br>
<input form="login" formaction="three.php" formmethod="get" type="submit" name="dosubmit" value="不通过"><br>
from2.html
<meta charset="utf-8">
<form id="login" action="login.php" method="get">
</form>
<input form="login" placeholder="please input value!" type="text" name="username"> <br>
<input form="login" formaction="one.php" formmethod="get" type="submit" name="dosubmit" value="删除"><br>
<input form="login" formaction="two.php" formmethod="post" type="submit" name="dosubmit" value="通过"><br>
<input form="login" formaction="three.php" formmethod="get" type="submit" name="dosubmit" value="不通过"><br>