I have this html:
<input required="" id="time" type="time">
js:
var time = $('#time').val();
console.log(time); // it outputs e.g. 10:00
var newTime = time--; // NaN
var convert = new Date(time); // Invalid Date
How to work with the value of input? I want to compare it to the other input's value or other basic operations like decrease time with 1 hour but I'm not able to convert it to Date object.
document.querySelector("#time").valueAsDateor.valueAsNumber-> HTMLInputElementvalueAsDateisDOMelement proerty , not jQuery method . See post.