为什么不管输入几都只出来default定义的的结果??
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>switch</title>
<script type="text/JavaScript">
function Whatsday(){
// var myweek =3;//myweek表示星期几变量
var myweek=prompt("今天周几?");
// alert(myweek);
switch(myweek)
{
case 1:
case 2:
document.write("学习理念知识");
break;
case 3:
case 4:
document.write("到企业实践");
break;
case 5:
document.write("总结经验");
break;
case 6:
case 7:
document.write("周六、日休息和娱乐");
break;
default:
document.write("没有星期八!更没有星期九!最爱慕课!");
}
}
</script>
</head>
<body>
<input type="botton" value="今天做什么?" onclick="Whatsday()" />
</body>
</html>