这个是获取的值有问题吗,怎么解决呢
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>switch</title>
<script type="text/JavaScript">
function jump(){
var myweek =document.getElementById("a");//myweek表示星期几变量
switch (myweek){
case 1:
case 2:
alert("学习理念知识");
break;
case 3:
case 4:
alert("到企业实践");
break;
case 5:
alert("总结经验");
break;
case 6:
case 7:
alert("周六、日休息和娱乐");
break;
default:
alert("您的输入有问题!");
}
}
</script>
</head>
<body>
<div>请输入工作日:</div>
<input type="text" id="a">
<input type ="button" value = "确认" onclick="jump()">
</body>
</html>