表单 form

<form action="   "  method="post和get">     </form>

action="  " 将表单提交到对应的地址

method=“  ” 提交方式   

get获取 

post传输

1.如何实现表单提交

<form   action="  "   method="  "> 

<button  type="submit">提交</button>

 

 </form>

2.表单控件

1.单行文本输入框text
<input type="text">
type类型 text文本
2.密码 password(隐藏)
<input type="password">
3.单选按钮 radio
<input type="radio">
单选按钮实现多选一,设置同一个name值
<input type="radio" name="sex">
默认选中checked
4.多选框 复选框checkbox
<input type="checkbox">
默认选中checked
check检票 box盒子
5.上传文件 file
<input type="file">

6.下拉框select
<select>
<opction>水冰月</opction>
<opction>武小道</opction>
<opction>艾斯</opction>
</select>
selected下拉框默认选中
option选项
下拉框多项选择中multiple="multiple"/吗哦踢剖

7.多行文本 textarea
<textarea></textarea>
cols一行多少个字
rows显示几行

8.按钮
-button
<button type="button">普通按钮</button>
<button type-"submit">提交</button>
<button type="reset">重置按钮</button>
-input
<input type="button" value="确定">
<input type="submit">
<input type-="reset">

图片按钮
<input type="image" src="路径">

表单的属性
1.提示信息 placeholder
2.值 value
3.必填项 required
4.最大字符
maxlength
5.禁用 disabled="disabled"
6.只读 readonly="readonly"

H5中input的新增属性
<button type="range">范围
<button type="search">搜索框
<button type="datetime-local">本地日期
date日期 time时间 local本地的

posted @ 2022-04-07 18:56  孟仔  阅读(35)  评论(0)    收藏  举报