1.表单的作用
作用:表单是和后台交互的手段
2.表单元素的写法
(1)通用写法
<input type=" 类型" name=“ ” value=“ ”>
3.表单的action属性和method属性是什么?
action:提交表单时向何处发送表单数据
method:如何发送表单数据,常用的两种请求方式
(1)get:会把内容显示在网址上(不安全),但是更快捷
(2)post:不会把内容显示在网址上,更安全
4.单选框
<input name=“ ” type=“radio” value=“ ” checked=“ checked”/>
5.多选框
<input name=“ ” type=“checkbox” value=“ ” checked=“ checked”/>
6.文本框
<input name=“ ” type=“text” value=“ ” />
7.密码框
<input name=“ ” type=“password” />
8.文件上传框
<input name=“ ” type=“file” />
9.文本区域
< textarea >< / textarea >
10.提交按钮
<input type=“ submit ” name=" " >
11.重置按钮
<input type=“ reset” name=" " >
12.按钮
<input type=“ button ” value= " " >
< button></ button>
13.下拉选择框
< select >
< option >–请选择-- </ option>
< option >… </ option>
< option >…</ option>
< /select >
14.表单元素的name属性和value属性的作用
name:是给后台的key(对值得描述)
value:规定表单元素的默认值
15.label标签的使用
label标签通常和input标签一起使用,label标签为input元素定义标注
语法格式:
< label for =" 关联控件的id" form=“所属表单id列表”>文本内容< / label>
表单
最新推荐文章于 2024-07-11 15:29:37 发布