What is the best way to get closest (up tree) given a class, but it can be a sibling of a parent.
I want to get "errors1" element start with element ".start"
<div>
...
<div class="errors">errors2</div>
<div>
.....
<div class="errors">errors1</div>
...
<div>...</div>
<div>
.....
<div class="start"></div>
</div>
</div>
</div>
Made a script but its really bad and doesnt work at all.
Thanks
EDITED: Added "..." to enhance that structure is dynamic. The point is to find the closest ".errors" up tree.