-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs14.html
More file actions
27 lines (27 loc) · 676 Bytes
/
Copy pathjs14.html
File metadata and controls
27 lines (27 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!--JavaScript program to check whether date entered in the text box is greater than or less than current date-->
<!DOCTYPE html>
<html>
<head>
<title>js14</title>
</head>
<body>
<input type="date" id="ipt">
<input type="button" value="find" onclick="compare()">
<div id="opt"></div>
<script type="text/javascript">
function compare()
{
var today = new Date();
var date1 = new Date(document.getElementById("ipt").value);
if(date1.valueOf() < today.valueOf())
{
document.getElementById("opt").innerHTML="entered date is less than current date";
}
else
{
document.getElementById("opt").innerHTML="entered date is greater than current date";
}
}
</script>
</body>
</html>