HTML:我可以在javascript函数中使用jquery方法,选择器吗?
<input id="otherCheckbox2" type="checkbox" value="Accepted" style="color: Black" class="chkdisplay" onchange="javascript:othercheckbxdisplay();" />
<span style="color: Black">Accepted</span> <br />
<input id="otherCheckbox3" type="checkbox" value="Contracted" style="color: Black" class="chkdisplay" onchange="javascript:othercheckbxdisplay();" />
<span style="color: Black">Contracted</span> <br />
<input id="otherCheckbox4" type="checkbox" value="Pending" style="color: Black" class="chkdisplay" onchange="javascript:othercheckbxdisplay();" />
<span style="color: Black">Pending</span><br />
<input id="otherCheckbox5" type="checkbox" value="Pre-Authorized" style="color: Black" class="chkdisplay" onchange="javascript:othercheckbxdisplay();" />
<span style="color: Black">Pre-Authorized</span> <br />
<input id="otherCheckbox6" type="checkbox" value="Show Deleted" style="color: Black" class="chkdisplay" onchange="javascript:othercheckbxdisplay();" />
<span style="color: Black">Show Deleted</span> <br />
<input id="otherCheckbox7" type="checkbox" value="Treated" style="color: Black" class="chkdisplay" onchange="javascript:othercheckbxdisplay();" />
<span style="color: Black">Treated</span> <br />
我的JavaScript函数与jQuery,但它不工作。 叫上一个按钮click.Wen这个功能我点击按钮alert("hi");
被激发,但不alert(index);
也说明我的主要问题,只是我这个问题的方式
function ShowHideDxColumn() {
alert("hi");
$(".ckhdisplay").each(function (index) {
if ($(this).is(":checked")) {
alert(index);
}
});
}
感谢ü
感谢您通知我,我的我真的犯了错误? –
将ü解释我,我可以使用jQuery方法,选择在javascript函数? –
是的,当然你可以使用jQuery方法和选择器在JavaScript函数,这正是它的设计使用。 – MrCode