Counting the number of option tags in a select tag in jQuery
Solution 1:
$('#input1 option').length;
This will produce 2
.
Solution 2:
The W3C solution:
var len = document.getElementById("input1").length;
$('#input1 option').length;
This will produce 2
.
The W3C solution:
var len = document.getElementById("input1").length;