0

j query in how to get the children without tag id using ? i have using table structure to get the children but last children not getting.

enter image description here

I have try this Code

$(document).ajaxComplete(function () 
    { 
        var table = $(".data-grid-draggable").children('tbody'); 
        for (let index = 0; index < table.length; index++) 
        { 
            if (table[index].children.length != 0) 
            { 
                var tr_length = table[index].children.length;
                for (let i = 0; i <= tr_length; i++) 
                { 
                    var td_tr_values = table[index].children[i];
                } 
            } 
        } 
    }); 
2
  • please share your code for more details
    – Msquare
    Mar 27, 2020 at 6:17
  • $(document).ajaxComplete(function () { var table = $(".data-grid-draggable").children('tbody'); for (let index = 0; index < table.length; index++) { if (table[index].children.length != 0) { var tr_length = table[index].children.length for (let i = 0; i <= tr_length; i++) { var td_tr_values = table[index].children[i] } } } }); Mar 27, 2020 at 6:26

1 Answer 1

0

try this to get child in js

    var get_value;
    get_value = document.getElementById("container").children[0].children[0].children[0].children[0].innerText;
console.log(get_value);

you add more children[0] and get your value from table.

click here to get more about children

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.