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