Below is code for select option and generate using php from database and i try to add selected=\"selected\" to value=\"4\" using jQuery or any javascri
selected=\"selected\"
value=\"4\"
This should work simple, $("#countryselect").val('4')
$("#countryselect").val('4')
It will automatically set selected=selected
selected=selected
Demo: http://jsfiddle.net/muthkum/zYRkC/