Created
September 7, 2020 09:33
-
-
Save firdaushqq/a0edd89fc80ab4753ef58fd15327bd15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Firdaus Haqiqi XI RPL 3</title> | |
<link rel="stylesheet" href="BuatIf.css" type="text/css"> | |
</head> | |
<body> | |
<p id="demo"> | |
<b>IF</b> akan memunculkan tulisan "Selamat Pagi!" | |
</p> | |
<p> | |
Jika pada opsi IF tidak ada, maka akan pindah ke <b>ELSE</b> memunculkan "Hello World"<br> | |
Kata yang muncul adalah: | |
</p> | |
<script> | |
var d = new Date() | |
var time = d.getHours() | |
if (time < 9){ | |
document.write("Selamat Pagi!"); | |
}else{ | |
document.write("Hello World!"); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment