select a option in jQueryMobile
I select a option works after loading the page in jquery did something asin:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>title</title>
<meta name="viewport" content="width=device-width initial-scale=1"/>
<link href="lib/jquery_mobile/jquery.mobile-1.3.1.min.css" rel="stylesheet" type="text/css"/>
<script src="lib/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
<script>
$(document).on('mobileinit',function(){
$.mobile.defaultPageTransition = "turn";
$.mobile.loader.prototype.options.textVisible = true ;
$.mobile.loader.prototype.options.theme = "b" ;
});
</script>
<script src="lib/jquery_mobile/jquery.mobile-1.3.1.min.js" type="text/javascript"></script>
<script>
$(document).on("pageinit",function(){
$('select#myselect option').removeAttr('selected');
$("#myselect option[value=<?php echo$value;?>]").attr("selected","selected");
$('select#myselect').selectmenu("refresh");
})
</script>
</head>
<body>
<div data-role='page'>
<div data-role='content'>
<select id='myselect'>
<option value='1'>one</option>
<option value='2'>two</option>
<option value='3'>three</option>
</select>
</div>
</div>
</body>
</html>
if charge with f5 if that works.