這樣寫的話,為什么顯示不了負數所帶來的顯示?
<html>
<head>
<title>js</title>
<script>
function check(){
var score;
score=prompt("請輸入您的分數:");
if (score>=90){
alert("您的成績優秀!");
? ? ? }
else if(score>=70){
alert("您的成績良好!")
}
else if(score>=60){
alert("您的成績及格!")
}
else if(0<score<59){
alert("您還需要努力哦!")
}
else if(score<0){
alert("請輸入正確的分數!")
}
}
</script>
</head>
<body>
<input type="button" name="click" value="點我查看" onClick="check()">
</body>
</html>
2020-04-02
<!DOCTYPE?html><html?lang="en"><head>????<meta?charset="UTF-8">????<meta?name="viewport"?content="width=device-width,?initial-scale=1.0">????????<title>js</title>????????<script>????????????function?check(){????????????var?score;????????????score=prompt("請輸入您的分數:");????????????if?(score>=90){????????????????alert("您的成績優秀!");????????????????}????????????else?if(score>=70){????????????????alert("您的成績良好!")????????????????}????????????else?if(score>=60){????????????????alert("您的成績及格!")????????????????}????????????else?if(score>0&&score<59){????????????????alert("您還需要努力哦!")????????????????}????????????else?if(score<0){????????????????alert("請輸入正確的分數!")????????????????}????????????}????????</script></head><body><input?type="button"?name="click"?value="點我查看"?onClick="check()"></body></html>2020-04-02
score>0&&score<59改成if (score>0)也能成立
2020-04-02
0<score<59那里應該是&&運算