Thursday, January 26, 2012

How to show Day of Week

JavaScript Code:
<script type="text/javascript">
function GetDays()
{
    var getDay=new Date();
    if(getDay.getDay()>0 && getDay.getDay()<5)
    {
      alert("It’s a WeekDay!");
    }
    else
    {
       alert("Its’ WeekEnd!")    
    }
}
</script>

HTML Code:
<input type="btn_getdays" onclick="GetDays()" value="Show Day!" />

No comments: