HTML表单学习3——输入类型
2016-12-27 17:30
387 查看
HTML表单学习3——输入类型补充
在HTML表单学习1中已经学习了几个,在本文将做一个补充!
1,输入类型:password
<input type=”password”>
定义密码字段
例子:
2,输入类型:checkbox
<input type=”checkbox”>定义复选框
例子:
3,输入类型:number
<input type=”number”>能对数字大小进行限制
例子:
<input type=”number” min=”1 max=”10”>
输入限制:
disabled
规定输入字段应该被禁用。
max
规定输入字段的最大值。
maxlength
规定输入字段的最大字符数。
min
规定输入字段的最小值。
pattern
规定通过其检查输入值的正则表达式。
readonly
规定输入字段为只读(无法修改)。
required
规定输入字段是必需的(必需填写)。
size
规定输入字段的宽度(以字符计)。
step
规定输入字段的合法数字间隔。
value
规定输入字段的默认值。
4,输入类型:data
<input type=”data”>
例子:
<input type=”data” name=”birthday>
5,输入类型:color
<input type=”color”>
用于颜色输入
例子:
<input type=”color” name=”color>
6,输入类型:rang
<input type=”rang”>用于包含一定范围内的数字输入字段
例子:
<input type=”rang” name=”point” min=”0” max=”10”>
7,输入类型:month
<input type="month">允许用户选择月份和年份
例子:
<input type="month" name="bdaymonth">
8,输入类型:week
<input type="week">允许用户选择周和年
例子:
<input type="week" name="bdayweek">
9,输入类型:time
<input type="time">允许用户选择时间
例子:
<input type="time" name="usr_time">
10,输入类型:datetime
<input type="datetime" >允许用户选择日期和时间
例子:
<input type="datetime" name="bdaytime1">
11,输入类型:datetime-local
<input type="datetime-local">允许用户选择日期和时间
例子:
<input type="datetime-local" name="bdaytime2">
12,输入类型:email
<input type="email">用于包含电子邮件的字段
例子:
<input type="email" name="email">
13,输入类型:search
<input type="search">用于搜索字段
例子:
<input type="search" name="googlesearch">
14,输入类型:url
<input type="url">用于包含url地址的字段
例子:
<input type="url" name="urlpage">
完!!
在HTML表单学习1中已经学习了几个,在本文将做一个补充!
1,输入类型:password
<input type=”password”>
定义密码字段
例子:
用户名: <input type=”text” name=”username” > <br> 密码: <input type=”password” name=”psw”> <br>
2,输入类型:checkbox
<input type=”checkbox”>定义复选框
例子:
<input type=”checkbox” name=”class” value=”Chinese”> 语文课 <br> <input type=”checkbox” name=”class” value=”math”> 数学课 <br>
3,输入类型:number
<input type=”number”>能对数字大小进行限制
例子:
<input type=”number” min=”1 max=”10”>
输入限制:
disabled
规定输入字段应该被禁用。
max
规定输入字段的最大值。
maxlength
规定输入字段的最大字符数。
min
规定输入字段的最小值。
pattern
规定通过其检查输入值的正则表达式。
readonly
规定输入字段为只读(无法修改)。
required
规定输入字段是必需的(必需填写)。
size
规定输入字段的宽度(以字符计)。
step
规定输入字段的合法数字间隔。
value
规定输入字段的默认值。
4,输入类型:data
<input type=”data”>
例子:
<input type=”data” name=”birthday>
5,输入类型:color
<input type=”color”>
用于颜色输入
例子:
<input type=”color” name=”color>
6,输入类型:rang
<input type=”rang”>用于包含一定范围内的数字输入字段
例子:
<input type=”rang” name=”point” min=”0” max=”10”>
7,输入类型:month
<input type="month">允许用户选择月份和年份
例子:
<input type="month" name="bdaymonth">
8,输入类型:week
<input type="week">允许用户选择周和年
例子:
<input type="week" name="bdayweek">
9,输入类型:time
<input type="time">允许用户选择时间
例子:
<input type="time" name="usr_time">
10,输入类型:datetime
<input type="datetime" >允许用户选择日期和时间
例子:
<input type="datetime" name="bdaytime1">
11,输入类型:datetime-local
<input type="datetime-local">允许用户选择日期和时间
例子:
<input type="datetime-local" name="bdaytime2">
12,输入类型:email
<input type="email">用于包含电子邮件的字段
例子:
<input type="email" name="email">
13,输入类型:search
<input type="search">用于搜索字段
例子:
<input type="search" name="googlesearch">
14,输入类型:url
<input type="url">用于包含url地址的字段
例子:
<input type="url" name="urlpage">
完!!
相关文章推荐
- html 表单设计时对输入文本数据类型的限制
- html表单基础之输入学习笔记
- HTML 表单元素、 输入类型、Input 属性
- HTML表单学习4——输入属性
- HTML 表单用于搜集不同类型的用户输入。
- HTML学习笔记(十三)HTML 表单和输入
- HTML 表单用于搜集不同类型的用户输入
- html表单基础之输入学习笔记
- HTML学习笔记--表单标记
- HTML学习感想(2)【使网页具有交互功能的工具—表单】
- Delphi学习手记——控制文本框输入的字符类型
- MOSS 2007 开发学习笔记(1) -- 自定义aspx类型的表单
- html系统学习之三 <表格,列表,表单>
- JavaScript与 HTML表单的交互过程,想要学习动态网页但是无从下手的新手看看。
- Form表单中的一种输入对象Input的不同类型
- JavaScript与 HTML表单的交互过程,想要学习动态网页但是无从下手的新手看看。
- [HTML]HTML 表单和输入
- HTML学习感想(4)【密码输入框、单选、复选框】
- HTML学习笔记【9】使用表单
- HTML学习笔记三表单和框架