In my web page, I would like to play sound when the current time equals to , for example, 5:00 pm.
What I did is:
<script type='text/css'>
var d = new Date();
var m = d.getMinutes();
var h = d.getHours();
if (h == 17 && m == 00){
document.write = "<embed src =\'notify.mp3\' hidden=\'true\' autostart=\'true\' loop=\'true\'></embed>";
}
</script>
I looked for a specific function that plays the sound and I found document.write
which doesn't work and doesn't make sense.
Any suggestion what I should do