Given the following DOM
<ul>
<li data-id="1">
<li data-id="2">
<li data-id="3">
<li data-id="1">
</ul>
We need to find the closest <li>
-Element with data-id="1"
to the one with data-id="3"
We tried:
$('[data-id=3]').siblings('[data-id=1]').first()
which of course returns the first in DOM and not the closest
We also tried:
$('[data-id=3]').closest('[data-id=1]')
which does not work as it's only returning ancestors.
Thanks for any hints.