Try this, you had a couple of errors in your JS and HTML.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<script type="text/javascript">
function check() {
var d = new Date();
var hour = d.getHours(), mins = d.getMinutes();
var current = hour + ':' + mins, user = document.f1.t1.value;
if (user < current) {
alert('Please enter the time greater than current time');
}
}
</script>
</head>
<body>
<form name="f1">
<input type="text" name="t1" id="t1" value="" onblur="check();" />
</form>
</body>
</html>
Bookmarks