开发者

How to use Modernizr for input type=datetime?

I made a custom build for HTML input fields & attributes and included t开发者_运维知识库hat on my page in the <head> but that's not working. What else do I need to do?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜