How to check, if a HTML5 input is supported?

后端 未结 4 1585
清歌不尽
清歌不尽 2021-01-11 12:47

I want to check in my website, if the visitors browser support a HTML5 input type. How should I do it?

4条回答
  •  不思量自难忘°
    2021-01-11 13:42

    i would comment on the accepted answer, but won't allow me without a certain reputation, so i'll do it this way. if a browser runs into an input type it doesn't recognize, it will automatically default to a 'text' input itself. so I would say the JS in the answer is unnecessary (unless you want to default to something other than 'text')

提交回复
热议问题