加了propmt為什么執(zhí)行不下去
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>switch</title>
<script type="text/JavaScript">
function a(){
//myweek表示星期幾變量
var myweek=3;
?myweek=prompt("ssss",myweek);
switch(myweek)
{
?case 1:
?case 2:
?document.write("學(xué)習(xí)理念知識");
?break;
?
?case 3:
?case 4:
?document.write("到企業(yè)實(shí)踐");
?
?break;
?case 5:
?document.write("總結(jié)經(jīng)驗(yàn)");
?break;
?
?case 6:
?case 7:
?document.write("周六、日休息和娛樂");
?break;
?
}
}
</script>
</head>
<body>
<input name="button" type="button" onclick="a()" value="請輸入星期幾">
? ??
</input>
</body>
</html>
2016-03-18
switch(?parseInt( myweek ) )
2017-09-19
<input name="button" type="button" onclick="a()" value="請輸入星期幾">
按鈕設(shè)置沒有</input>
2017-09-19
switch(?parseInt( myweek ) )
switch(?Number( myweek ) )
2016-06-12
prompt()返回的是字符串,你可以把case 1:中的1換成“周一”或“1”(用引號把1引上),就可以了
2016-03-18
同求答案
2016-03-18
當(dāng)我沒說好了,題目沒看清
2016-03-18
用法錯誤,去掉prompt第二個參數(shù)