首页 > 代码库 > 储存this

储存this

$(‘#zhetenga‘).click(function(){ 
//this是被点击的#zhetenga 
var that = this; 
$(‘.zhetenga‘).each(function(){ 
//this是.zhetenga循环中当前的对象 
//that仍然是刚才被点击的#zhetenga 
}); 
}); 

储存this