In the code below,I have two inputs of type time. I would like as soon as I click the button I can calculate the difference between these two times. How could I do this?
function calc(){
let start = document.getElementById('start').value;
let end = document.getElementById('end').value;
}
<input type="time" name="" id="start">
<input type="time" name="" id="end">
<button onclick="calc();"> TEST </button>