Let’s say you have this (very) simple dropdown:

   United States
   United Kingdom

And one day you decide to figure out how much elements or “option” tags the given “select” has.

It’s easy:

var items = $('#my_dropdown option').length;
alert(items);

The above should immediately display “2” since we have 2 countries in the select dropdown.

Leave a Reply

Your email address will not be published. Required fields are marked *