jquery count selected elements code example
Example 1: jquery count elements
var count_elements = $('.class').length;
Example 2: get select option count using jquery
$(document).ready(function(){
console.log($('#input1 option').size());
console.log($('#input1 option').length);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<select data-attr="dropdown" id="input1">
<option value="Male" id="Male">Male</option>
<option value="Female" id="Female">Female</option>
</select>