Created
March 18, 2024 11:42
-
-
Save nihat-js/3e74e92510cdd0d89da8104faddc73ae to your computer and use it in GitHub Desktop.
select[all,none] jquery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#admin_basket_check_all").on("change",function(){ | |
if ($(this).is(":checked")){ | |
$("tbody [type='checkbox']").prop("checked",true) | |
}else{ | |
$("tbody [type='checkbox']").prop("checked",false) | |
} | |
}) | |
$(document).on("change","tbody [type='checkbox']",function(){ | |
let isAllChecked = $("tbody input:checked").length === $("table tbody input:not(:checked)").length | |
$("#admin_basket_check_all").prop("checked", isAllChecked) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment