checkbox
程序员文章站
2022-05-10 10:07:46
创建: 选中取消: 原生js: document.getElementById("ck").checked = true[false]; Jquary: $("#ck").attr("checked", true[false]); 获取是 ......
创建:<input type="checkbox" id="ck">
选中取消:
原生js: document.getElementById("ck").checked = true[false];
Jquary: $("#ck").attr("checked", true[false]);
获取是否选中:
原生js:var d = document.getElementById("ck").checked;
Jquary:var d = $("#ck").is(":checked");
推荐阅读