Hello, I have 3 input
that receives hours and minutes of a timepicker
:
<input type="text" id="seg1" onBlur="calcular">
<input type="text" id="seg2" onBlur="calcular">
<input type="text" id="seg">
The first one receives (08:30), the second receives (10:30) and the third one returns (02:00).
I use the function below for real numbers in real time:
function calcular(){
var segent = parseInt(document.getElementById('segent').value, 10);
var segsai = parseInt(document.getElementById('segsai').value, 10);
document.getElementById('resultseg').value = segent - segsai;
}
But I'm not able to make a small (or large) code that works to return the value (02:00) in hours and minutes in real time.