views:

12

answers:

0
<style type="text/css">
.hidden {
display: none; 
}
.show {
display: block;
}
</style> 


<div class="hidden" id="day">day</div>
<div class="hidden" id="night">night</div>

<script>

<!--
 day=document.getElementById("day");
 night=document.getElementById("night");

 var date = new Date();
    if (date.getHours() < 8 || date.getHours() >= 20) {
            night.setClassName("show");   
    } else {
            day.setClassName("show");
    }
-->
</script>

Can anyone please tell why this script doesn't work on Facebook? The purpose of this script is to display one image if the time is between 8:00 - 20:00 and another if it's in 20:00 - 8:00. But I can't make it work! When I run this code nothing is displayed at all.

Can anyone please help?

Thanks in advance