从性能的角度来看,有没有更好的方法来确定一个元素是否被分配了一个类?
$('#foo').hasClass('bar');
或
$('#foo').is('.bar');
https://stackoverflow.com/questions/4901553
相似问题