Count Number of List Items with jQuery

So you want to know how many items are in that list:

<ul id="imagelist">
	<li>Image 1</li>
	<li>Image 2</li>


Make sure you’ve got the jQuery libaray running and run the following lines after page load.

alert($("#imagelist li").size());

Back to Blog

Say Hello

You can reach me by email, I'd love to hear from you.