This code is returning an empty array when I run it even though there is a div with the attribute [data-directory] in the container.
$(container).children( '[data-directory]' )
container is valid, and the children are there when I log $(container), I'm not sure why it isn't pulling the child that is there though.
please check to see whether container
is a valid and exists if it does. then
probably $(container).find( '[data-directory]' )
would do
.children would only look in the immediate children
. where as .find
will go through all the descendants which i think is what you want
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