How can I set the value of a DropDownList using jQuery?

flesh picture flesh · Nov 15, 2008 · Viewed 732.3k times · Source

As the question says, how do I set the value of a DropDownList control using jQuery?

Answer

Nick Berardi picture Nick Berardi · Nov 15, 2008
$("#mydropdownlist").val("thevalue");

just make sure the value in the options tags matches the value in the val method.