I'm trying to make small script. I have main div that has 300 inner divs and I access them by:
$("#items").find(".item").each(function(index,ele){
console.log(ele);
})
So it logs me all the inner divs. Now i want to access labels and read their inner html of these found divs.
How i can do that? Tried to mess with ele.label & ele.$("label"), but it doesn't work.
You need to use .find or .children to find children/nested elements.
$(ele).children('label') // takes just direct children
$(ele).find('label') // take all nested labels
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With