我需要知道每个中有多少<div>
元素<li>
。所以是这样的:
<ul>
<li>
<div> Some image 1 </div>
<div> Some image 2 </div>
<div> Some image 3 </div>
</li>
<li>
<div> Some image 4 </div>
<div> Some image 5 </div>
</li>
<li>
<div> Some image 6 </div>
<div> Some image 7 </div>
<div> Some image 8 </div>
<div> Some image 9 </div>
</li>
</ul>
函数的输出:
First <li> has 3 <div>
Second <li> has 2 <div>
Third <li> has 4 <div>