我想創建一個簡單的if ... else如果對於1 - 10的評級系統。JS if。 。 。否則如果語句評級從1 - 10
這是我寫的,但它不起作用。我相信我的問題在於我寫作論點的方式。但我不確定。
這就是:
var rate = prompt ("How satisfied are you? On a scale of 1 - 10");
if (rate > 7 && < 11)
{
alert(" Thank you for the high marks!");
}
else if (rate > 4 && <= 7)
{
alert ("We are working to get better");
}
else if (rate > 0 && < 5)
{
alert("We are horrible");
}
else
{
alert("Only use numbers 1 - 10");
}
// thanks for taking a look
而不是猜測語言語法,請學習它。 – PointedEars
在問你這個問題之前,你看過控制檯中的錯誤嗎? –
[Code Academy](http://www.codecademy.com/tracks/javascript)是學習JavaScript的絕佳網站。 –