Tag Archives: input

Number of Selected Items in a Multiple Select Box with jQuery

With the html: <select name=”my_list” multiple=”multiple”> <option value=”one”>1</option> <option value=”two”>2</option> <option value=”three”>3</option> <option value=”four”>4</option> <option value=”five”>5</option> </select> One way to find the number of options selected: $(“select[name='my_list']>option:selected”).length

Posted in jquery, Programming | Tagged , , | Leave a comment