I would like to determine the number of images inside a specific div. I'm pretty sure that I have code to select the elements that I would like to count:
var imageCount = $("#work img").size();
And the div itself couldn't be simpler:
<div id="work" class="shown">
<img src="graphics/gallery/001.jpg" />
<img src="graphics/gallery/002.jpg" />
</div>
But when I ask
alert(imageCount);
It returns 0, not 2! What am I doing wrong? And yes, I am warning inside ready, so I know that the elements are available ...
source
share