HTML5新增type类型,HTML5新增属性

 html5版本新增了很多类型,我们挑一些常用的进行展示:
详细学习地址可以参照w3c进行学习:
https://www.w3school.com.cn/html5/att_input_type.asp

<!DOCTYPE html>
<html>
        <head>
                <meta charset="UTF-8">
                <title></title>
        </head>
        <body>
                <form action="" method="get">
                        <!--email:
                                html5的类型可以增加校验
                        -->
                        <input type="email" name="email" />
                        <!--url-->
                        <input type="url" />
                        <!--color-->
                        <input type="color" />
                        <!--number:
                                min:最小值
                                max:最大值
                                step:步长
                                value:默认值:一定在步长的范围中,否则不能提交
                        -->
                        <input type="number" min="1" max="10" step="3" value="4"/>
                        <!--range-->
                        1<input type="range" min="1" max="10" name="range" step="3"/>10
                        <!--date-->
                        <input type="date" />
                        <!--month-->
                        <input type="month" />
                        <!--week-->
                        <input type="week" />
                        <!--提交按钮-->
                        <input type="submit" />
                </form>
        </body>
</html>

 

HTML5新增属性

<!--
                                HTML5新增属性:
                                multiple:多选
                                placehoder:默认提示
                                autofocus:自动获取焦点
                                required:必填项
                        -->
                        <input type="text" autofocus="autofocus"/>
                        <input type="text" required="required" />


posted @   CodeWhisperer001  阅读(10)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示