How would I got about selecting the first parent of a set of elements that contains ALL of those elements?
For example:
<body>
<dl>
<dt>Items:</dt>
<dd>
<ul>
<li>Item 1<div class="item-info">...</div></li>
<li>Item 2<div class="item-info">...</div></li>
<li>Item 3<div class="item-info">...</div></li>
</ul>
</dd>
</dl>
</body>
I want something like this:
$('.item-info').commonParent();
and it would return the equivalent of:
[$('ul')]
Is there an easy way to do this with jQuery selectors? Or am I gonna have to write a plugin?
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