Is there a built-in function in jQuery that would allow me to get all parents to a parent with a specific identifier? I have a deeply nested unordered list, and if I have a link to one of the "whether", I need to find all the parent "li" to the root of "ul". If I use parent (), it gives me all parents to the root of the document. One way is to simply write a recursive function and check the parent id, but if there is something built, I would prefer to use this.
source
share