04HTML基础-表单标签

2016-11-11  本文已影响0人  旅途中的任任任小皓
647982-9f6f2cfcfdf04c42.png647982-9f6f2cfcfdf04c42.png

表单标签

<form>
    所有的表单内容,都要写在form标签里面
</form>

input标签

1. 明文输入框

2. 暗文输入框

3. 给输入框设置默认值

4. 规定输入字段中字符的最大长度

5. 单选框(radio)

<input type="radio" name="xingbie" /> 男
<input type="radio" name="xingbie" /> 女
<input type="radio" name="xingbie" /> 妖
647982-50b3e2882284cf05.jpg.png647982-50b3e2882284cf05.jpg.png

6. 多选框(checkbox)

<input type="checkbox" name="aihao"/> 篮球
<input type="checkbox" name="aihao"/> 足球
<input type="checkbox" name="aihao"/> 棒球
647982-03fa0d7df4f030c9.jpg.png647982-03fa0d7df4f030c9.jpg.png
给单选、多选设置默认值

lable标签

<!--给文本框添加绑定-->
<label for="account">账号:</label>
<input type="text" id="account" />

<!--给单选框添加绑定-->
<input type="radio" name="sex" id="man" /> <label for="man">男</label>

<!--给多选框添加绑定-->
<input type="checkbox" id="basketball" />
<label for="basketball">篮球</label>
647982-ff740fbfb4ba3622.jpg.png647982-ff740fbfb4ba3622.jpg.png

7.按钮

1. 图片按钮
2. 重置按钮
3. 提交按钮
4. 隐藏域
上一篇 下一篇

猜你喜欢

热点阅读