Skip to content

Commit 40cfcb4

Browse files
committed
if in js
1 parent ef28452 commit 40cfcb4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Compare Dates js array.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
5+
<p id="demo"></p>
6+
7+
<script>
8+
var today, someday, text;
9+
today = new Date();
10+
someday = new Date();
11+
someday.setFullYear(2100, 0, 14);
12+
13+
if (someday > today) {
14+
text = "Today is before January 14, 2100.";
15+
} else {
16+
text = "Today is after January 14, 2100.";
17+
}
18+
document.getElementById("demo").innerHTML = text;
19+
</script>
20+
21+
</body>
22+
</html>

0 commit comments

Comments
 (0)