I want a script in HTML, that shows a messagebox when it opens with: Good day or good evening, so it has to know what time it is. And I also want to show the day with that too.
I have this so far:
CODE
<script>
hour = new Date ().getHours ()
if (hour > 17) {
alt = 'morning'
} else if (hour > 12) {
alt = 'afternoon'
} else {
alt = 'evening'
}
alert('Good' + alt);
</script>
hour = new Date ().getHours ()
if (hour > 17) {
alt = 'morning'
} else if (hour > 12) {
alt = 'afternoon'
} else {
alt = 'evening'
}
alert('Good' + alt);
</script>
So now I need to show the days after that, also in a messagebox like alert, could anyone help me?
Thanks,
Fear