<body>
<p id="time"></p>
<script>
const sayings = [];
sayings[0] = "message 1";
sayings[1] = "message 2";
sayings[2] = "message 3";
sayings[3] = "message 4";
sayings[4] = "message 5";
sayings[5] = "message 6";
sayings[6] = "message 7";
const date = new Date();
let hour = date.getHours();
document.getElementById("time").innerHTML = sayings[hour];
</script>
</body>
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.