【发布时间】:2022-10-13 23:15:50
【问题描述】:
我想计算一个表的 td 中的 div 数并将其存储在一个变量中。
html 图片:https://imgur.com/a/T476Tkx
或者这里是 html 的示例:
<td colspan="1" class="timeslot" xpath="1">
<div class="timeslot" style="height: 133px; background-color: rgb(167, 211, 255); width: 145px;"><div class="timenotitle"><span> 7:00 am</span></div></div>
<div class="timeslot" style="height: 133px; background-color: rgb(167, 211, 255); width: 145px;"><div class="timenotitle"><span> 8:00 am</span></div></div>
<div class="timeslot" style="height: 133px; background-color: rgb(167, 211, 255); width: 145px;"><div class="timenotitle"><span> 9:00 am</span></div></div>
</td>
我怎样才能做到这一点?
【问题讨论】:
-
这回答了你的问题了吗? Count how many elements in a div
标签: html variables html-table count