- input控件(重点)(单标签)
1.文本框text
用户名:<input tpye="text"/>
2.密码框password
密码:<input type="password"/>
3.单选框radio
性别:<input tpye="radio" name="sex"/>男
<input type="radio" name="sex"/>女 通过定义同一个name来表示同一组
4.复选框checkbox
爱好:<input type="checkbox" name="hobby">篮球
<input type="checkbox" name="hobby">足球
<input type="checkbos" name="hobby">乒乓球
可以同时选择多个 通过定义同一个name来表示同一组
5.默认选项checked="checked"
性别:<input tpye="radio" name="sex" checked="checked"/ checked>男
<input type="radio" name="sex"/>女
通过定义同一个name来表示同一组 ,通过checked表示初始默认选项为男
6.按钮
- 普通按钮:
button + value
搜索:<input type="button" value="搜索啥"/>
- 提交按钮
submit
<input tpye="submit" /> 默认为“提交”,可以通过value更改
- 重置按钮
reset
<input type="reset" /> 默认为“重置”,可以通过value更改
- 图像按钮
image + src
<input type=“image” src="">
- 文件域
file
上传文件:<input type="file"/>
7.空间允许最大字符数maxlength
8.label标签
<lable> <><> </lable>
- 文本域
<textarea> </textarea>
留言板<br/>
<textarea cols="每行数目" rows="每列数目">请输入留言</textarea>
- 下拉菜单
<select>
<option>选项1</option>
<option>选项2</option>
<option selected="selected">选项3</option> 默认选择选项3
</select>