<!DOCTYPE html> <html> <head> <title>JavaScript第一章(基础)</title> <link rel="icon" type="image/x-icon" href="static/images/favicon.ico"> <script> // 1、在页面head标签的内容部分插入script标签,并在script标签的内容部分书写js程序 document.write('你好') </script> <script type="text/javascript" src="static/all.js"></script> </head> <body> <script type="text/javascript"> //1.给学生的具体成绩划分等级 var grade=69; 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('不及格'); } //2判断是否为闰年 var years=1996; if(years%4 !=0 || years%100 !=0){ alert('不是闰年'); }else{ alert('是闰年!'); } </script> </body> </html>