case值只能是数字吗?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>switch</title>
<script type="text/JavaScript">
function my()
{var myweek =document.getElementById("con").value;//myweek表示星期几变量
switch(myweek)
{
case a:
case b:
alert("学习理念知识");
break;
case c:
case d:
alert("到企业实践");
break;
case e:
alert("总结经验");
break;
default:
alert("周六、日休息和娱乐");
}
}
</script>
</head>
<body>周计划
<input type="text" id="con">
<input type="button" value="点击" onclick="my()">
</body>
</html>