如何确定是否.attr('class')存在?
.attr('class')
我正在使用此代码:
if(jQuery(this).attr('class') != undefined && jQuery(this).hasClass('myclass')) { //Do something }
它似乎不起作用.
html javascript jquery class
class ×1
html ×1
javascript ×1
jquery ×1