happysmile
happysmile

Reputation: 7777

reset dropdown control to default value using javasccript

i have div tag inside the div tag i have an drop down control which is binded to the database values https://stackoverflow.com/questions --select-- india us Auz

i have an checkbox control once i check then this the div tag will be visable uncheck the checkbox theen div tag will be invisable.

if the user select some value in the dropdown control like "AUZ" again if user checks or unchecks the checkbox it should always show first value "--select--"

hope my Question is clear

can any one give the syntax how to achieve, any help would be appreciated.

Thanks

Upvotes: 5

Views: 11130

Answers (1)

Adam Rackis
Adam Rackis

Reputation: 83356

To reset your dropdown, select its first option, and set the selected attribute to true.

$("#yourSelectId option:first").attr("selected", true);

Upvotes: 5

Related Questions