I am trying to create and android app using jquerymobile and cordova 2.0.0. I am planning to add localStorage which will save settings of app to android storage. Right now I am trying to force my jquerymobile select menus to show the currently saved value.

Example:
Imagine that you have a menu (settings) consisting of 3 items (disabled, enable, compatibility mode) and you chose compatibility mode and save settings. Then variable settings is stored and set to compatibility. But when you load the settings next time it will looks like menu (settings) is set to disabled because it is the first option in list. So I want my program to display currently selected and saved option in settings. I have tried it by using body onload calling load() function which would set selectedIndex from stored value but it didnt worked (maybe my bad code).

So I need my javascript to construct select menu and change the order of options but it is not working.

I figured it out myself. Just needed to use this code: document.getElementById("transitions").selectedIndex = 2/*selected value*/; $("#transitions").selectmenu('refresh'); also tried to replace this document.getElementById("transitions").selectedIndex = 2 with this $("#transitions").val() = 1 but it didnt worked
–
horinSep 11 '12 at 13:27

If you found a solution post it below as a "solution" and mark it as one please
–
ShenaniganzSep 11 '12 at 16:48