Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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>
Comment

jquery count selected options

var count = $("#mySelect :selected").length;
Comment

PREVIOUS NEXT
Code Example
Javascript :: phone number regex angular 
Javascript :: image next src url 
Javascript :: react native open email client 
Javascript :: valid email patter check jquery 
Javascript :: generate random base 64 string js 
Javascript :: upload file using ajax 
Javascript :: get position of element 
Javascript :: transformorigin gsap 
Javascript :: node string to json 
Javascript :: regex for time in hh:mm:ss 
Javascript :: Datatable Change page size for pdf 
Javascript :: javascript add new array element to start of array 
Javascript :: javascript repeat element in array 
Javascript :: updating react version 
Javascript :: useeffect will unmount 
Javascript :: how to empty an element in javascript 
Javascript :: javascript middle of array 
Javascript :: how to check if a json object contains a key in jquery 
Javascript :: jquery loop through json 
Javascript :: parse integer javascript 
Javascript :: jquery change text of div 
Javascript :: import fa icons react 
Javascript :: set data-id value jquery 
Javascript :: javascript max length with elipsis 
Javascript :: canvas resize canvas 
Javascript :: remove vowels from string javascript 
Javascript :: react native textinput lowercase 
Javascript :: js substring between two characters 
Javascript :: moment locale 
Javascript :: upgrade nodejs and npm ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =