How to use Modernizr for input type=datetime?

自作多情 提交于 2020-01-01 09:57:45

问题


I made a custom build for HTML input fields & attributes and included that on my page in the <head> but that's not working. What else do I need to do?


回答1:


Not sure what it is you are trying to accomplish, but the "Input Attributes" option adds tests for the following <input> attributes: autocomplete, autofocus, list, placeholder, max, min, multiple, pattern, required, and step. -- Not sure what this has to do with <input type="datetime" ...> elements?

The "Input Types" option does adds tests for the following types of <input> elements: search, tel, url, email, datetime, date, month, week, time, datetime-local, number, range, and color.

However, from the documentation:

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.

In general, Modernizr doesn't "do" anything (besides the HTML5 shim), it just allows you to detect for the existence of modern features on the browser.



来源:https://stackoverflow.com/questions/7197016/how-to-use-modernizr-for-input-type-datetime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!