Blogger Information
Blog 21
fans 0
comment 0
visits 19961
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
javascript基础
电动机的博客
Original
808 people have browsed it

总结:

1、JavaScript与html的嵌入方式:head内部、body内联、外部引入后缀点js;

2、变量的声明 关键字var  let/const;

3、数据类型:字符串、数字、布尔、数组、对象、NULL、undefined;

4、算数运算符:/、*、+、-、%、++、--;

5、赋值运算符:=、+=、-=、%=、/=;

6、比较运算符:==、===、!=、>、<、>=、<=;

7、逻辑运算符:&&(并且)、||(或者)、!(取反)

8、条件语句 if(  ){  };  if(){   }else{ }; if(){  }else if(){ }else{};

实例

<!DOCTYPE html>
<html>
<head>
	<title>javascript 第一节课</title>
</head>
<body>
  <script type="text/javascript">
  	// 成绩分类
  	var grate=89;
  	if (grate>=90) {
  		alert('成绩优秀!');
  	}else if (grate>=80) {
  		alert('成绩不错!');
  	}else if (grate>=60) {
  		alert('成绩合格!');
  	}else{
  		alert('成绩不合格,请继续努力!');
  	}
  	// 闰年
    var  year=2000;
    if (year%4 !=0) {
    	alert('不是闰年');
    }else if (year%100 !=0) {
    	alert('不是闰年');
    }else{
    	alert('是世纪闰年');
    }

  </script>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

 

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!