javascript - How to check if a browser supports <input type="time" /> -
What browsers, one < Invalid values will be rejected when assigning property to If there is a browser problem that I do not know about, then & lt; Input type = "", HTML, javascript,
.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"); }
. 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
Post a Comment