1.创建 form表格
<form action="[value]" method="post">
Input elements
</form>
action:【指定处理表格数据的程序或文档地址】
method:【通知服务器的请求方法】
get
:或许去要的信息并在地址栏中传递数据
post
:向服务器发送大量数据时使用该方法
method属性若未指定,则默认为get
2.输入元素
(1)文字【text fileds】【默认宽度为20个字符】 text
<input type="text" name="firstname">
<form action="[value]" method="[value]">
<p>First Name:</p>
<input type="text" name="firstName">
<p>Last Name:</p>
<input type="text" name="lastName">
</form>
(2)密码 password
<input type="password">
<form action="[value]" method="[value]">
<p>Password:</p>
<input type="password" name="password">
</form>
3.单选按钮 radio
<input type="radio">
4.选框 checkbox
<input type="checkbox">
5.标签 lable
<label>
<input type="radio" name="language" value="english">English</input>
<input type="radio" name="language" value="spanish">Spanish</input>
</label>
说明:
当input
位于label
内部时,点击选框或文字都可以选中
当无label
标签时,只能通过点击选框选中