課程
/前端開發(fā)
/JavaScript
/JavaScript入門篇
我想在一個if語句之下在嵌套一個if語句,該怎么處理?比如說我代碼這樣!在score>=95里面在做一次選擇,該怎么辦?怎樣才能讓里面那個else生效呢?
2016-04-06
源自:JavaScript入門篇 2-4
正在回答
if(//條件){
????if(score>=95){
????????//相應(yīng)的語句
????}
????else{
????????//相應(yīng)語句
}
else if(//條件){
????//相應(yīng)語句
else{
一只特立獨(dú)行的doge 提問者
if(score>=95){? ? ? document.write("優(yōu)");
}else {
? ? ? document.write("良");
}else if(score>=80)?{
? ? ? document.write("合格");
}else if? (score<80)?{
? ? ? document.write("不合格");
else if 搭配
if(score>=90){
????????非常棒
????}else{
????????很棒
????????}
}else if(score>=80){
舉報
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門
3 回答為什么我的if嵌套if會沒???confirm和prompt
2 回答if嵌套怎么執(zhí)行不了??
1 回答if...else...條件語句如何實(shí)現(xiàn)嵌套,confirm里套著prompt,prompt點(diǎn)擊取消后網(wǎng)頁還是會彈出來
1 回答if...else的問題
2 回答關(guān)于if的問題
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-04-06
if(//條件){
????if(score>=95){
????????//相應(yīng)的語句
????}
????else{
????????//相應(yīng)語句
????}
}
else if(//條件){
????//相應(yīng)語句
}
else{
????//相應(yīng)語句
}
2016-04-06
if(score>=95){
? ? ? document.write("優(yōu)");
}else {
? ? ? document.write("良");
}else if(score>=80)?{
? ? ? document.write("合格");
}
else if? (score<80)?{
? ? ? document.write("不合格");
}
2016-04-06
else if 搭配
2016-04-06
if(score>=90){
????if(score>=95){
????????非常棒
????}else{
????????很棒
????????}
}else if(score>=80){
}