JQuery hide div based on day
Posted
by Ryan
on Stack Overflow
See other posts from Stack Overflow
or by Ryan
Published on 2010-05-07T17:10:01Z
Indexed on
2010/05/07
17:18 UTC
Read the original article
Hit count: 191
I'm trying to hide a div based on the day of week?
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
var rightNow = new Date();
var day = rightNow.getUTCDay();
if (day = 5;) {
$('#friday').hide();
}
</script>
<div id='friday'>
friday
</div>
<br>
<div id='saturday'>
saturday
</div>
<br>
<div id='sunday'>
sunday
</div>
<br>
<div id='monday'>
monday
</div>
© Stack Overflow or respective owner