<table class="mainTable" cellpadding="0" cellspacing="0" align="center">
<tr>
<td class="day">test 1</td>
<td data-info="" class=" c"></td>
<td data-info="91" class="widgets c91">data 1</td>
<td data-info="" class=" c"></td>
<td data-info="109" class="widgets c109">data 2</td>
<td data-info="" class=" c"></td>
<td data-info="126" class="widgets c126">data 3</td>
</tr>
<tr>
<td class="day">test 2</td>
<td data-info="83" class="widgets c83">data 4<div class="triangle"></div></td>
<td data-info="" class=" c"></td>
<td data-info="100" class="widgets c100">data 5<div class="triangle"></div></td>
<td data-info="" class=" c"></td>
<td data-info="118" class="widgets c118">data 6<div class="triangle"></div></td>
<td data-info="" class=" c"></td>
</tr>
<tr>
<td class="day">test 3</td>
<td data-info="84" class="widgets c84">data 7</td>
<td data-info="92" class="widgets c92">data 8</td>
<td data-info="101" class="widgets c101">data 9</td>
<td data-info="110" class="widgets c110">data 10</td>
<td data-info="119" class="widgets c119">data 11</td>
<td data-info="127" class="widgets c127">data 12</td>
</tr>
</table>
我正在使用简单的 html dom 生成一个包含表中项目的数组。我希望能够识别td元素是否具有 div 类“三角形”并将其输出到数组。