怎么是这样的结果呢
以下是我的代码,它怎么没有获取prompt中的值做判断,而是直接跳到default中了
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>switch</title>
<script type="text/JavaScript">
function week(){
var myweek =prompt("请输入星期几");//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("周六、日休息和娱乐");
default:
document.write("您输入的信息有误");
}
document.write("<br>今天是星期"+myweek);
}
</script>
</head>
<body>
<button onclick="week()">点击查看周计划</button>
</body>
</html>