<html>
<head>
<title>demo of getting day of the week from eneterd date</title>
<script type="text/javascript">
function disp_day(){
var str=document.getElementById('dt').value;
var a1=str.split("/");
var dt= new Date();
dt.setMonth(a1[0]-1);// Month part
dt.setDate(a1[1]); // Date part
dt.setFullYear(a1[2]); // Year part
//display the full date //
document.getElementById("txtHint1").innerHTML=dt;
var disp =dt.getDay(); // get the day of the week 0 to 6
var day_name=new Array(7);
day_name[0]="Sunday";
day_name[1]="Monday";
day_name[2]="Tuesday";
day_name[3]="Wednesday";
day_name[4]="Thursday";
day_name[5]="Friday";
day_name[6]="Saturday";
document.getElementById("txtHint").innerHTML=day_name[disp];
}
</script>
</head>
<body>
<div id="txtHint1"></div>
<div id="txtHint"></div>
<input type=text name=dt id=dt><input type=button value='Display Day' onClick=disp_day()><br>
mm/dd/yy
<br>
</body>
</html>