为啥,值取出来,case语句没打印出来
为啥,值取出来,case语句没打印出来
2016-09-01
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>switch</title>
<script type="text/JavaScript">function show(){var a = document.getElementById("con").value;
var myweek = a;//myweek表示星期几变量
document.write(myweek);
switch(myweek)
{
case "1":
case "2":
document.write("学习理念知识");
break;
case "3":
case "4":
document.write("到企业实践");
break;
case "5":
document.write("总结经验");
break;
default:
document.write("周六、日休息和娱乐");
}}
</script>
</head>
<body><div>
<input type="text" id="con" placeholder="请输入数字"/>
<button onclick="show()">确认</button></div>
</body>
</html>
举报