这是我到目前为止写的代码
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Registration</title>
<meta name="HandheldFriendly" content="True"/>
<meta name="apple-touch-fullscreen" content="YES" />
<meta name="apple-touch-fullscreen" content="YES" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes" />
<link rel="stylesheet" media="all" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js "></script>
<script type="text/javascript" src="my.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
<script type="text/javascript">
$('#mothertongue').live("change",function() {
alert($(this).val());
});
</script>
</head>
<body>
<div data-role="page" data-theme="e" id="page3" data-add-back-btn="true">
<div data-theme="e" data-role="header">
<h3></h3>
<a href="index.html" class="ui-btn-right" data-icon="home" data-iconpos="notext"
data-direction="reverse">Home</a>
</div>
<div data-role="content" style="padding: 15px">
<div data-role="fieldcontain">
<label for="selectmenu3">
<p>
Mother Tongue
</p> </label>
<select name="mothertongue" id="mothertongue" >
<option selected="selected" value="-1">Select Mother Tongue</option>
<option value="Telugu">Telugu</option>
<option value="Kannada">Kannada</option>
<option value="Hindi">Hindi</option>
<option value="Marathi">Marathi</option>
<option value="Tamil">Tamil</option>
<option value="Assamese">Assamese</option>
<option value="Bengali" >Bengali</option>
<option value="Coorgi">Coorgi</option>
<option value="Dogri">Dogri</option>
<option value="English">English</option>
<option value="Garhwali">Garhwali</option>
<option value="Gujarati">Gujarati</option>
<option value="Kashmiri">Kashmiri</option>
<option value="Konkani">Konkani</option>
<option value="Kumaoni">Kumaoni</option>
<option value="Kutchi">Kutchi</option>
<option value="Magahi">Maithili</option>
<option value="Malayalam">Malayalam</option>
<option value="Manipuri">Manipuri</option>
<option value="Marwari">Marwari</option>
<option value="Nepali">Nepali</option>
<option value="Oriya">Oriya</option>
<option value="Punjabi">Punjabi</option>
<option value="Sindhi">Sindhi</option>
<option value="Tulu">Tulu</option>
<option value="Urdu">Urdu</option>
</select>
</div>
</div>
</div>
</div>
</body>
</html>
母语的更改事件根本没有触发。我已经为更改事件编写了这个脚本,但它根本不会触发。
<script type="text/javascript">
$('#mothertongue').live("change",function() {
alert($(this).val());
});
</script>
我整晚都在为这个问题拉头发。请帮助我,否则我可能会秃头:(