var div1Class = $('#div1').attr('class');
例
<div id="div1" class="accordion accordion_active">
检查上面的div中包含的类
var a = ("#div1").attr('class'); console.log(a);
控制台输出
accordion accordion_active