Using above code it find all div's from parent-div and iterate over it and fetch id attribute of each element and push into array. So in the example on my post when Cbx3 is selected nothing else would be affected as it has no child LI's ALL To subscribe to this RSS feed, copy and paste this URL into your RSS reader. How to access element present inside a iframe from parent window? Using robocopy on windows led to infinite subfolder duplication via a stray shortcut file. How can I avoid this? To learn more, see our tips on writing great answers. Thanks for contributing an answer to Stack Overflow! Get all data attributes of an element and their value in jquery. WebReturns the first ancestor of the selected element. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. 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. Here is the simple syntax to use this method . This worked fine for me: var data = "
how to get all child elements in jquery