当我使用下面的方法时,我无法获取 jQuerythis
隐藏该元素。
$('.purplePanda').click(function(e){
this.hide();
});
我收到此错误:
Uncaught TypeError: this.hide is not a function
Replace
this.hide();
with
$(this).hide();
因此你的函数应该是这样的
$('.purplePanda').click(function(e){
$(this).hide();
});
查看官方文档here
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)