0
我是jQuery的新的,我不知道如何使用它,这是我的代码创建样子如何使用jquery复选框?
<div id="checkbox-container">
<div class="hidefull">
<input type="checkbox" value="hideFull" id="check-hide-full-table">Hide Full
</div>
<div class="hideempty">
<input type="checkbox" value="hideEmpty" id="check-hide-empty-table">Hide Empty
</div>
</div>
和jQuery我创建这样
function test(){
alert("test called");
$("#check-hide-empty-table").prop("checked", true);
}
所以问题是,怎样检查使用jQuery的复选框?我已经看this但仍未检查。有人知道我的代码有什么问题吗?
我想创建如果加载新页面,该复选框,选中。
仅供参考,警报显示。
您有一个额外的','你'prop(“选中”,true)'。删除它,这应该工作正常。 – Santi
啊sry,我的代码没有额外的','但仍然没有working.i只是错字,我已经编辑我的问题, – Pentolan
当你打电话给你的'测试'功能? – jkris