js this

dom中的this

指的是对象自己  例如javascript

<script type="text/javascript">
		
		// this  js里关键字 
			function t(_this){
				
				//alert(_this)
				_this.style.border='1px solid red'
			}
			
		
		
		//jq  css html click
		</script>
	</head>
	<body>
		
		<form action="" method="post">
			<input type="text"  id="t1" value="111" onblur="t(this)" />
			<input type="submit" value=""/>
		</form>

函数中的this   

function test(){/// this指的是方法对象  方法转成对象  属性和值
		
		this.name='张三';//对象
		
		this.aa=function(){
			
			alert('对象里面的方法');
		}
	}
	
var t=new test();
	alert(t.age);*/
	//test().;

对象中的thiscss

var obj={name:'张三',tt:function(){
		
		alert(this.name)
	}};
	obj.tt();*/
相关文章
相关标签/搜索