Why does jquert get the parent element of the parent always reporting an error?

clipboard.png

clipboard.png
jquert checkboxcheckbox

clipboard.png

Mar.10,2021

use [I] to get the dom object, and the dom object has no parent method, so you need to use eq (i) to get the jquery object:

.
$(".checkboxdele").eq(i).parent().parent().remove();

Update:
interlaced deletion, endless deletion at a time:

$(".dele").click(function () {
    let arr = $(".checkboxdele")
    for (let i = arr.length - 1; i >= 0; i--) { // 
        if (arr[i].checked) {
            arr.eq(i).parent().parent().remove();
        }
    }
})

$(".checkboxdele") [I] is a dom object, not a jquery object. There is no parent method


you print out $(".checkboxdele") [I] to see what its nodes are, and then print its parent () , and you'll soon be able to locate the problem.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b391a3-2c15d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b391a3-2c15d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?