JQuery DropDownList Get or set the selected item

By TSN ...

The below sample explains how we can set or get the selected item for dropdownlist using JQuery.

//This gets the value selected in the dropdownlist.
var text = $('#r1c3 option:selected').text();

//set the value for the dropdwnlist ,but make sure the value must exist in the list of item of dropdownlist
$("#r1c3").val("XYZ");

JQuery DropDownList Get or set the selected item  (2071 Views)