超级基本的问题,但我无法弄清楚为什么以下代码不起作用:
HTML
<label for="flip-1">Flip switch:</label>
<select name="flip-1" id="flip-1" data-role="slider">
<option value="off">Off</option>
<option value="on">On</option>
</select>
<button id="submit">Submit</button>
JS
$(document).delegate("#submit", "tap", function() {
alert($("#flip-1").val());
});
Uncaught TypeError: Cannot call method 'call' of undefined (jquery.mobile-1.3.0-beta.1.js:2823)
按下提交时返回。