我正在使用下面的代码来获取选定的 chnaeckboxes。这些复选框是在XSLT中动态添加的。
//html
<div id="centerNameChk">
<input type="checkbox" name="emailList" onclick="">
Add Workforce Center to email
</input>
</div>
//jquery
if ($("#centerNameChk :checked").size() > 0) {
//my code is here
}
上面的代码在 FF、Chrome 中运行良好,但在 IE$("#centerNameChk :checked").size()
中总是返回 0。
我正在使用 jQuery 1.4.2 并且我更新到 1.7.2 但仍然是同样的问题。
有什么建议么...
谢谢