this和$(this)的关系

环境关键字this引用的是DOM元素

$(this)是jQuery对象

下面点击按钮分别alert一下

alert(this);

alert($(this));

获取DOM对象的属性id,可以

$(this).attr('id');

this.id;

他们的关系为 $(this)[0]==this

原文地址:https://www.cnblogs.com/tinyphp/p/3546142.html