在HTML中,一个完整的表单通常由表单控件(也称为表单元素)、提示信息和
表单域3个部分构成
<form action="url" method="post" name=“名称”>
<!--1. Action在表单收集到信息后,需要将信息传递给服务器进行处理,
action属性用于指定接收并处理表单数据的服务器程序的url地址。
2. method用于设置表单数据的提交方式,其取值为get或post。
3. name用于指定表单的名称,以区分同一个页面中的多个表单-->
<!--一般默认为get get是显示所有信息,post显示当前-->
用户名:<input type="text" name="yonghuming">
密码:<input type="password" name="mima"> <!--密码域-->
<input type="file"> <!--文件域-->
<input type="image" src="">
<label>
ggg <input type="text"><!--点击ggg光标直接聚焦于text框-->
</label>
<textarea cols="20"rows="20"><!--文本内容-->
文本内容
</textarea>
<input tyoe="image" src=""> <!--以图像形式提交按钮-->
<input type="text" maxlenth="8"><!--控件允许输入最多字符-->
<select>
<option>皇后</option>
<option selected="selected">皇贵妃</option>
<option>妃</option>
</select>
<!--slected=selected:默认选择等同于复选框checked=checked-->
<input type="submit"> <!--注册按钮,默认value为注册,配合form表单域用-->
<input type="reset"> <!--重置按钮,默认value为重置,配合form表单域用-->
</form>