我创建了一个非常简单的jsFiddle 示例,将单击处理程序分配给两个单选按钮:
$(document).ready(function () {
$(".title").on("click", function (event) {
alert('clicked');
});
});
如您所见,每次选择单选按钮时,都会调用两次处理程序,为什么?
<label class="title">
<input type="radio" name="heading" checked="checked" />Introduction and General Information about the Marketing Tool
</label>
<label class="title">
<input type="radio" name="heading" />Implementation Steps of the Marketing Tool
</label>