Get value from select
Description
The following code shows how to get value from select.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script type="text/javascript"
src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.js"></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.css">
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){<!-- w w w . j av a2 s. co m-->
$("#myButton").click(function(){
var val = $(".mySelect option:selected").val()
alert(val);
});
});//]]>
</script>
</head>
<body>
<section data-role="page">
<section data-role="content">
<input type="button" value="what is the value" id="myButton" />
<select
class="mySelect">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
</section>
</section>
</body>
</html>