属性
属性是指对象包含的值,使用’对象名.属性名’的方式进行操作,如 document.myfrom.first.value
工在讲话:徐高
方法
√在代码里,使用’对象名.方法名()’来调用该对象的方法。
√ alter(”)=Window.alter(”)
事件
响应用户操作、完成交互,如OnClick、OnKeyDown
√一般可以分为鼠标事件、键盘事件及其他事件

鼠标事件以及含义

onmousedown 按下鼠标健
 onmousemove 移动鼠标
 onmouseout 鼠标离开某一个网页对象
 onmouseover 鼠标移动到某一个网页对象上
 onmouseup 松开鼠标键
 onclick 单击鼠标键
 ondHnck 双击鼠标键
 
 键盘事件以及 意义
 onkeydown 按下一个键
 onkeyup 松开一个键
 onkeypress 按下然后松开一个键

自定义对象{

开发人员根据自己的需要而定义的新对象

}

JavaScript内置对象{

JavaScript将一些常用功能预先定义成对象,用户可以直接使用,这就是内置对象。

如字符串对象,数学对象,日期对象,数组对象,正则表达式对象等

}

浏览器内置对象{

浏览器对象是根据浏览器根据系统当前的配置和所装载的页面为JavaScript提供的一系列可供使用的对象。

如wiindow对象,Document对象,History对象等

}

使用Object关键字创建对象

使用function关键字创建对象

function Car(name ,color){
			 	this.name=name
			 	this.color=color
			 	this.run=function(){
			 		return "最高时速280Km"
			 	}
			 	
			 } 
			 var car=new Car("奥迪A9" ,"黑色 ")
			document.write("车型:"+car.name+"<br />")
			document.write("颜色:"+car.color+"<br />")
			document.write("说明:"+car.run()+"<br />")
var Car = new Object() Car.name = "奥迪a9"
      Car.color = "黑色"
      Car.run = function() {
      	return "最高时速280Km"
      }
      document.write("车型:" + Car.name + " <
      		br / > ") document.write("
      		颜色: "+Car.color+" <
      		br / > ") document.write("
      		说明: "+Car.run()+" <
      		br / > ")</script>

字符串对象

方法(参数列表)/属性 说明
 length 返回字符串长度
 charAt(num) 返回参数num指定索引处的字符
 charCodeAt(num) 返回参数num指定索引处的字符的Unicode值
 indexOf(string[,num]) 返回参数string在字符串中首次出现的位置
 lastindexOf(string(,num]) 返回参数string在字符串中最后出现的位置
 substring(index1Lindex2l)返回字符串中index1和index2之间的字符串
 substr(index1[,num]) 返回字符串中index1之后的num个字符返回字符串大写形式 
 toUpperCase( 
 toLowerCase) 返回字符串小写形式 
 split(reg,num) 根据参数传入的正则表达式或者字符(串),将字符串分割成字符串数组
 replace(reg,string) 根据参数传入的正则表达式或者字符(串),将字符串替换为新字符串
 search(string) 返回参数string出现的位置