Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#DEL").click(function(){
- $("table tr input:checked").parents('tr').remove();
- });
- $("#DEL").click(function(){
- var checked = $("table tr input:checked").size();
- var total = $("table tr").size();
- if (checked < total) {
- $("table tr input:checked").parents('tr').remove();
- } else {
- alert("You cannot delete all rows!");
- }
- });
- $("#DEL").click(function () {
- console.log($("table tr input:checked").length)
- if ($("table tr").length === 1
- || $("table input:checked").length === $("table tr").length) {
- alert("cannot delete last tr")
- } else {
- $("table tr input:checked").parents('tr').remove();
- }
- });
- $("table tr:not(:first) input:checked").parents('tr').remove();
- alert("Sorry, cannot delete all rows");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement