加入收藏 | 设为首页 | 会员中心 | 我要投稿 湖南网 (https://www.hunanwang.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程 > 正文

html5定制表单_动力节点Java学院清算

发布时间:2020-03-16 15:33:05 所属栏目:编程 来源:站长网
导读:副问题#e# HTML5中存在多种差异的输入框和按钮,通过配置input元素的type属性来实现,除此之外,HTML5中还支持选择列表、多行输入框等,这些元素都有本身的用途和属性,下面逐一先容。 单行文本输入框 type为text暗示input元素为一个单行文本框,是input元

<form method="post" action=":8080/form"> <p><label for="name">Name: <input value="Adam" disabled id="name" name="name"/></label></p> <p><label for="password">Password: <input type="password" placeholder="Min 6 characters" id="password" name="password"/></label></p> <p><fieldset> <legend>Vote for your favorite fruit</legend> <label for="apples"> <input type="radio" checked value="Apples" id="apples" name="fave"/> Apples </label> <label for="oranges"> <input type="radio" value="Oranges" id="oranges" name="fave"/> Oranges </label> <label for="cherries"> <input type="radio" value="Cherries" id="cherries" name="fave"/> Cherries </label> </fieldset></p> <input type="submit" value="Submit Vote"/> </form>

在chrome中的结果如下:

限命名目输入框

type属性值email、tel和url别离对应电子邮箱地点、电话号码和URL,支持的属性包罗:
1)list:指定为文本框提供提议值的datalist元素,其值为datalist元素的id值;
2)maxlength:输入字符的最大数量;
3)pattern:指定用于验证输入的正则表达式;
4)placeholder:指定关于所需数据范例的提醒;
5)readonly:暗示文本框只读;
6)required:表白用户必需输入一个值;
7)size:可见的字符数量;
8)value:指定元素的初始值。
email还支持multiple属性,暗示可以接管多个电子邮箱地点。

<form method="post" action=":8080/form"> <p><label for="name">Name: <input value="Adam" disabled id="name" name="name"/></label></p> <p><label for="password">Password: <input type="password" placeholder="Min 6 characters" id="password" name="password"/></label></p> <p><label for="email">Email: <input type="email" placeholder="user@domain.com" id="email" name="email"/></label></p> <p><label for="tel">Tel: <input type="tel" placeholder="(xxx)-xxx-xxxx" id="tel" name="tel"/></label></p> <p><label for="url">Your homepage: <input type="url" id="url" name="url"/></label></p> <input type="submit" value="Submit Vote"/> </form>

在chrome中的结果如下:
 

时刻和日期输入框

HTML5中新增了一些输入日期和时刻的范例,包罗:
1)datetime:获取天下时日期和时刻,包罗时区信息;
2)datetime-local:获取当地日期和时刻,不包括时区信息;
3)date:获取当地日期,不含时刻和时区信息;
4)month:获取年代信息,不含日、时刻和时区信息;
5)time:获取时刻;
6)week:获取当前礼拜。
 

日期和时刻的input元素支持的特殊属性包罗:

(编辑:湖南网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读