实例
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html"; charset="utf-8" /> <title>第一章</title> <link rel="icon" type="image/x-icon" href="static/images/favicon.ico" /> <!-- <script type="text/javascript" src="static/all.js"></script> --> <script> document.write('你好') </script> </head> <body> <!-- <script> alert('帅哥') </script> --> <script> // var x=8; // console.log(x) var grade=59; if(grade>=60){ alert("成绩合格"); }else{ alert("不合格"); } var years=1998; if(years%4 !=0){ alert("是闰年"); } var grade=77; if(grade>=90 &&grade<=100){ alert("优秀"); }else if(grade>=80 &&grade<=89){ alert("良好"); }else if(grade>=70 &&grade<=79){ alert("良"); }else if(grade>=60 &&grade<=69){ alert("及格"); }else{ alert("不及格"); } // }else if(grade>70){ // alert("良"); // }else if(grade>60){ // alert("及格"); // }else(grade<60){ // alert("不及格") // } </script> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例