javascript - How to check if a browser supports <input type="time" /> -


What browsers, & lt; Input type = "", HTML, javascript,

one < Invalid values ​​will be rejected when assigning property to .type element of code> input element.

  Try {var input = document.createElement ("Input"); Input.type = "time"; If (input.type === "time") {console.log ("supported"); } Else {console.log ("not supported"); }} Hold (e) {console.log ("not supported"); }  

If there is a browser problem that I do not know about, then . Winner should also do this by using HTML .

  var div = document.createElement ("div"); Div.innerHTML = "& lt; input type = 'time' & gt;"; If (div.firstChild.type === "time") console.log ("supported"); Else console.log ("not supported");  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -