I need to change the selected option with a value coming from the database.
Here is the code:
// this code is in ondeviceready function. function onDeviceReady() { $("#txtgender2").val(data.data.gender).selectmenu("refresh"); }
This code is somewhere in the div
<div> <select name="txtgender2" id="txtgender2" data-role="slider"> <option value="Male" >Male</option> <option value="Female">Female</option> </select> </div>
How to change the selected selectmenu option?
source share