版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/eddy23513/article/details/81510256
1.typeof判断
如果存在某个属性 (“#aid”).attr(“rel”))==”undefined”) 即可
if (typeof($(this).attr("hasclicked")) == "undefined"){
//code
$(this).attr('hasclicked',true);
}