我有一些像下面这样的html。我已经遍历了 div(accordionContents) 内的所有元素。在循环内我需要检查元素 h2 是否应用了两个 css 类(acc_trigger 和 active) 的条件。我该怎么做?
<div id="accordionContents">
<div class="accordioncontainer">
<h2 class="acc_trigger active">
<a href="#"> <img class="openImage" src="Images/closed.png">
<div class="openHeader">Division : <b>Quality Assurance</b>(4 items)</div></a></h2>
<div class="acc_container" style="display: block;">
<div class="dataRowTeam">
<div class="riskStartContent">
<div class="riskGridHeader">
weekStart</div>
</div>
<div class="riskEndContent">
<div class="riskGridHeader">
90%</div>
</div>
</div>
</div>
</div>
<div class="accordioncontainer">
<h2 class="acc_trigger">
<a href="#"> <img class="openImage" src="Images/closed.png">
<div class="openHeader">Division : <b>Quality Assurance</b>(4 items)</div></a></h2>
<div class="acc_container" style="display: none;">
<div class="dataRowTeam">
<div class="riskStartContent">
<div class="riskGridHeader">
weekStart</div>
</div>
<div class="riskEndContent">
<div class="riskGridHeader">
90%</div>
</div>
</div>
</div>
</div>
</div>