課程
/前端開(kāi)發(fā)
/JavaScript
/JavaScript進(jìn)階篇
本題用switch該如何做
2017-03-06
源自:JavaScript進(jìn)階篇 4-10
正在回答
啊剛沒(méi)看清題目……用兩次switch不就好啦
墨陌默 提問(wèn)者
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>switch</title>
<script type="text/JavaScript">
var myweek =3;//myweek表示星期幾變量
switch(myweek)
{
?case 1:
?case 2:
?document.write("學(xué)習(xí)理念知識(shí)");
?break;
?case 3:
?case 4:
?document.write("到企業(yè)實(shí)踐");
?case 5:
?document.write("總結(jié)經(jīng)驗(yàn)");
?default:
?document.write("周六、日休息和娛樂(lè)");
}
</script>
</head>
<body>
</body>
</html>
舉報(bào)
本課程從如何插入JS代碼開(kāi)始,帶您進(jìn)入網(wǎng)頁(yè)動(dòng)態(tài)交互世界
1 回答用switch語(yǔ)句
1 回答本體用switch語(yǔ)句~該怎么寫(xiě)?
3 回答switch語(yǔ)句問(wèn)題
2 回答switch語(yǔ)句
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-03-06
啊剛沒(méi)看清題目……用兩次switch不就好啦
2017-03-06
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>switch</title>
<script type="text/JavaScript">
var myweek =3;//myweek表示星期幾變量
switch(myweek)
{
?case 1:
?case 2:
?document.write("學(xué)習(xí)理念知識(shí)");
?break;
?case 3:
?case 4:
?document.write("到企業(yè)實(shí)踐");
?break;
?case 5:
?document.write("總結(jié)經(jīng)驗(yàn)");
?break;
?default:
?document.write("周六、日休息和娛樂(lè)");
}
</script>
</head>
<body>
</body>
</html>