Reputation: 159
I want to change the option selected by the code in the dropdown
$('#ddd option[value="1"]').prop('selected', true);
but it doesnt work for this is mobile phonegap application with jquery.
i think i need to refresh #ddd control but i couldnt succeed with jquery.
i tryed to use jquery and jquery mobile together but i couldnt work it out.
how can i refresh #ddd control with jquery (not jquery mobile)?
thanks...
Upvotes: 0
Views: 695
Reputation: 87083
You can try this:
$('#ddd').val('1');
Above will set the selected value <option value="1"></option>
.
You can also trigger change event:
$('#ddd').val('1').change();
Upvotes: 1