HTML 学习笔记-表单项标签type 属性值
表单项标签type 属性值text 普通⽂本框password 密码框email 邮箱框,简单验证radio 单选框 选项必须有相同的Name属性值,value属性设置实际提交的值。checked属性代表默认选中checkbox 复选框,选项必须有相同的name属性值,value属性设置实际提交的值,checked属性代表默认选中date ⽇期框time 时间框datetime-local 时间⽇期框number 数字框range 滚动条数值框 min 最⼩值 max最⼤值 step步进值search 可清除⽂本框tel 电话框url ⽹址框file ⽂件上传框
hidden 隐藏域 value属性设置实际提交的值type 属性<input type = "text"/>  普通⽂本输⼊框<input type = "password"/>  密码输⼊框<input type = "email"/> 邮箱输⼊框<input type = "radio"/>  单选框。必须有相同的name 属性值,value 属性真实提交的数据,checked 属性默认选中<input type = "checkbox"/> 多选框。必须有相同的name 属性值,value 属性真实提交的数据,checked 属性默认选中1
2
3
4
5
6<!DOCTYPE html ><html lang ="en "><head >    <meta charset ="UTF-8">    <title >表单项标签</title ></head ><body >    <!--    表单项标签:<label>  表单元素说明    属性:for 属性,属性值必须和表单标签id 属性值⼀致    表单项标签:<input>  多种类型数据    属性:        type-数据类型        id-唯⼀标识        name-提交服务器的标识        value-默认的数据值        placeholder-默认的提⽰信息        required-是否必须    按钮标签:<button>    属性:        type-按钮的类型(submit 提交、reset 重置、button 普通按钮)    -->
1
2
3
4
5
6
7
8
9
10
html中提交表单用什么属性11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<form action  = "#" method  = "get " autocomplete ="off ">        <label for  = "username ">⽤户名:</l
abel >        <input type  = "text " id  = "username " name  = "usernname " /><br />        <label for  = "password ">密码:</label >        <input type  = "password " id  = "password " name  = "password " /><br />        <label for  = "email ">邮箱:</label >        <input type  = "email " id  = "email " name  = "email "/>  <br />        <!--单选框  name 属性值必须相同  value 时提交的数据-->        <label for  = "gender ">性别:</label >        <input type ="radio " id  = "gender " name  = "gender " value ="man "/>男        <input type ="radio "  name  = "gender " value ="woman "/>⼥        <input type ="radio "  name  = "gender " value ="other "/>其他<br />        <!--多选框  选择checked 标识已经选上-->        <label for  = "hobby ">爱好:</label >        <input type  = "checkbox " id  = "hobby " name  = "hobby " value  = "music " checked />⾳乐        <input type  = "checkbox " name  = "hobby " value  = "game "/>游戏<br />        <label for  = "birthday ">⽣⽇:</label >        <input type  = "date " id  = "birthday " name  = "birthday "/><br />        <label for  = "time ">当前时间:</label >        <input type  = "time " id  = "time " name  = "time "/><br />        <label for  = "insert ">注册时间:</label >        <input type  = "datetime-local " id  = "insert " name  = "insert "/><br />        <label for  = "age ">年龄:</label >        <input type  = "number " id  = "age " name  = "age "/><br />        <label for  = "range ">⼼情值(1~10):</label >        <input type  = "range " id  = "range " name  = "range " min  = "1" max  = "10" step  = "1"/><br />        <label for  search >可全部清除⽂本:</label >        <input type  = "search " id  = "search " name  = "search "/><br />        <label for  = "tel ">电话:</label >        <input type  = “tel” id 
= "tel " name  = "tel "/><br />        <label for  = "url ">个⼈⽹站:</label >        <input type  = "url " id  = "url " name  = "url "/>        <label for  = "file ">⽂件上传:</label >        <input type  = "file " id  = "file " name  = "file "/>        <label for  = "hidden ">隐藏信息:</label >        <input type  = "hidden " id  = "hidden " name  = "hidden "/>                <button type  = "submit ">提交<button >        <button type  = "reset ">重置<button >    </form ></body ></html >2829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。