想实现类似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 scd(){
var myweek=document.getElementById("week").value;//myweek表示星期几变量
switch(myweek)
{
case 1:
case 2:
document.write("学习理念知识");
break;
case 3:
case 4:
document.write("到企业实践");
break;
case 5:
document.write("总结经验");
break;
case 6:
document.write("周六、日休息和娱乐");
break;
default:
alert("不许乱来呦")
}
}
</script>
</head>
<body>
<div>
<input type="text" value="输入星期几" id="week"/>
<button type="submit" onclick="scd()">提交</button>
</div>
</body>
</html>