正常人怎么了 if/else ?
if/else
inst = $(this); if (inst.hasClass('foo')) { // do something } else if (inst.filter('.bar').attr('id') == 'foo') { // do something else }