亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

點擊按鈕取消,如何不出現提示框

????<!DOCTYPE HTML>

????<html>

????<head>

????<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

????<title>prompt</title>

????? <script type="text/javascript">

????? function rec()

????? {

???? var score; //score變量,用來存儲用戶輸入的成績值。

???? score =prompt();

????? ? if(isNaN(score))

???? {

???? ? alert("請輸入數字");

????? }

????? ? else if(score<=0 || score>100)

???? {

???? alert("成績是0-100,請重新輸入");

????? ? }

???? else if(score>80)

???? {

???? alert("牛逼");

???? }

????? ? else if(score>60)

???? {

???? alert("可以");

???? }

????? ? else

???? {

???? alert("是個人才");

???? }

????? }

????? </script>

????</head>

????<body>

????? ? <input name="button" type="button" onClick="rec()" value="點擊我,對成績做評價!" />

????</body>

????</html>

????

正在回答

4 回答

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>prompt</title>

? <script type="text/javascript">

? function rec(){

var score; //score變量,用來存儲用戶輸入的成績值。

score =? prompt("請輸入你的成績")? ? ? ? ? ? ? ;

if(score!=null) {

if(score>=90)

{

? ?document.write("你很棒!");

}

else if(score>=75)

? ? {

? ?document.write("不錯吆!");

}

else if(score>=60)

? ? {

? ?document.write("要加油!");

? ? }

? ? else

{

? ? ? ?document.write("要努力了!");

}

}

? }

? </script>

</head>

<body>

? ? <input name="button" type="button" onClick="rec()" value="點擊我,對成績做評價!" />

</body>

</html>


0 回復 有任何疑惑可以回復我~

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>prompt</title>

? <script type="text/javascript">

? function rec(){

var score; //score變量,用來存儲用戶輸入的成績值。

score =prompt("請輸入你的成績:");

if(score>=90)

{

? ?document.write("你很棒!");

}

else if(score>=75)

? ? {

? ?document.write("不錯吆!");

}

else if(score>=60)

? ? {

? ?document.write("要加油!");

? ? }

? ? else

{

? ? ? ?document.write("要努力了!");

}

? }

? </script>

</head>

<body>

? ? <input name="button" type="button" onClick="rec()" value="點擊我,對成績做評價!" />

</body>

</html>


0 回復 有任何疑惑可以回復我~

為什么呢,看提示就知道被你的判斷給攔下了。

0 回復 有任何疑惑可以回復我~

? <!DOCTYPE HTML>

? ? <html>

? ? <head>

? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

? ? <title>prompt</title>

? ? ? <script type="text/javascript">

? ? ? ? ? function rec() {

? ? ? ? ? ? ? var score; //score變量,用來存儲用戶輸入的成績值。

? ? ? ? ? ? ? score = prompt();

? ? ? ? ? ? ? if (score != null && score != "") {

? ? ? ? ? ? ? ? ? if (isNaN(score)) {

? ? ? ? ? ? ? ? ? ? ? alert("請輸入數字");

? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? else if (score <= 0 || score > 100) {

? ? ? ? ? ? ? ? ? ? ? alert("成績是0-100,請重新輸入");

? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? else if (score > 80) {

? ? ? ? ? ? ? ? ? ? ? alert("牛逼");

? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? else if (score > 60) {

? ? ? ? ? ? ? ? ? ? ? alert("可以");

? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? else {

? ? ? ? ? ? ? ? ? ? ? alert("是個人才");

? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? }

? ? ? ? ? }

? ? ? </script>

? ? </head>

? ? <body>

? ? ? ? <input name="button" type="button" onClick="rec()" value="點擊我,對成績做評價!" />

? ? </body>

? ? </html>


2 回復 有任何疑惑可以回復我~
#1

小魚魚同學

大佬, 這才是正解。
2020-06-04 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

點擊按鈕取消,如何不出現提示框

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號