Can i ask if how to validate time using javascript in combox contain having a choices and it can validate if she/he choose the time that already past
<input type="time" id="time" name="timeval">
Can i ask if how to validate time using javascript in combox contain having a choices and it can validate if she/he choose the time that already past
<input type="time" id="time" name="timeval">
if you have time in HH:MM:SS (24 hr)format than you can do like as below
var str1 = "10:20:45",
str2 = "05:10:10";
if (str1 > str2)
alert("Time 1 is later than time 2");
else
alert("Time 2 is later than time 1");
get current time as below
var d = new Date();
var curr_hour = d.getHours();
var curr_min = d.getMinutes();
var curr_sec = d.getSeconds();
document.write(curr_hour + ":" + curr_min + ":"
+ curr_sec);