表单元素

2016-08-10  本文已影响0人  撕心裂肺1232

<form>表单
<form action ="(处理表单数据的服务器的文件URL)" method ="POST"或"GET"> .... </form>

<input>表单元素
*文本框 *
<input type ="text" name ="xx">
单选框
<input type ="radio" name ="xxx" value ="aa"> <input type ="radio" name ="xxx" value ="bb"> .....
(加checked属性表默认选项)

复选框
<input type ="checkbox" name ="xxx" value ="aaa"> <input type ="checkbox" name ="xxx" value ="bbb"> .....
(加checked属性表默认选项,在name属性值后加"[]",表可多选)

文本区
<textarea name="xxx" rows ="10" cols ="50">
选择菜单
<select name ="xxx"> <option value ="aa">....</option> <option value ="bb">....</option> ... </select>
(加multiple属性表多选菜单)
数字输入
<input type ="number" min ="0" max ="10">
范围输入
<input type ="range" min ="10" max= "100" step ="5">
颜色输入
<input type ="color">
日期输入
<input type ="data">
email输入
<input type ="email" >
url输入
<input type ="url">
tel输入
<input type ="tel">
文件输入
<input type ="file" name ="doc">

上一篇 下一篇

猜你喜欢

热点阅读