<div id="images">
<a href="resources/certified_training/1.png" rel="shadowbox[certifiedtraining];width=510;height=372">Image -1</a>
<a href="resources/certified_training/2.png" rel="shadowbox[certifiedtraining];width=510;height=372">Image -2</a>
<a href="resources/certified_training/3.png" rel="shadowbox[certifiedtraining];width=510;height=372">Image -3</a>
<a href="resources/certified_training/4.png" rel="shadowbox[certifiedtraining];width=510;height=372">Image -4</a>
<a href="resources/certified_training/5.png" rel="shadowbox[certifiedtraining];width=510;height=372">Image -5</a>
</div>
我想获取这个div中的图像数量。他们是5,我想用JavaScript或jQuery阅读它.. 如何做到这一点?如何检查在javascript或jQuery的div中有多少图像?
该div中没有图像。有''标签,但没有'' – CodingIntrigue
只需使用该div中所需元素的匹配选择器,然后查看['length'](http://api.jquery.com/length/)返回的jQuery对象... – CBroe
该''div'中没有图像 - 只有5'a'个元素 –