I would like to determine the number of images inside a certain div. I am fairly sure I have the code to select the elements 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 for
alert(imageCount);
It returns 0, not 2! What am I doing wrong? And yes, I am alerting inside a ready
function so I know the elements are available...