<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>if...else</title> <script type="text/javascript"> var score =80; //score变量存储成绩,初值为80 if (score>=60); { document.write("很棒,成绩及格了。"); } else { document.write("加油,成绩不及格。"); } </script> </head> <body> </body> </html>
我已经明白错在哪里了
if (score>=80)后面不应该加;