微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javascript – 如何使用Modernizr输入type = datetime?

我为 HTML输入字段做了一个自定义构建&属性并包含在我的页面上的< head>但那不起作用.我还需要做什么?

解决方法

不确定您要完成的是什么,但“输入属性”选项会为以下< input>添加测试.属性自动完成,自动对焦,列表,占位符,最大,最小,多个,模式,必需和步骤. – 不确定这与< input type =“datetime”...>有什么关系?元素?

“输入类型”选项确实为以下类型的< input>添加了测试.元素:搜索,电话,网址,电子邮件,日期时间,日期,月份,周,时间,日期时间 – 本地,数字,范围和颜色.

但是,从文档中:

These (input) types can enable native datepickers,colorpickers,URL
validation,and so on. If a browser doesn’t support a given type,it
will be rendered as a text field. Modernizr cannot detect that date
inputs create a datepicker,the color input create a colorpicker,and
so on—it will detect that the input values are sanitized based on the
spec.

一般来说,Modernizr不会“做”任何事情(除了HTML5垫片),它只允许您检测浏览器上现代功能的存在.

原文地址:https://www.jb51.cc/js/158718.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐