jQuery to retrieve and set selected option value of html select element

to get/set the actual selectedIndex property of the select element use:

$("#select-id").prop("selectedIndex");

$("#select-id").prop("selectedIndex",1);

Leave a Comment