在 jQuery Mobile 1.3.1 中单击或更改复选框时,我无法执行 jQuery 函数。我已经尝试了所有我知道的尝试,所以任何帮助将不胜感激。
这是html:
<form>
<ul data-role="listview" data-split-icon="gear" data-split-theme="d">
<li style="padding:0">
<a href="#" style="padding:0">
<fieldset data-role="controlgroup" class="task-container">
<input type="checkbox" name="checkbox-v-2a" id="checkbox-1">
<label for="checkbox-1" style="border: none;margin: 0">Task name</label>
</fieldset>
</a>
<a href="#purchase">Purchase album</a>
</li>
.
.
.
</ul>
</form>
这是JavaScript(jQuery):
$("#checkbox-1").change(function() {
alert("hello world!");
});