I have a structure of divs inside divs, something like this:
<div class='parent'>
<div class='a first'>something here</div>
<div class='a'>something here</div>
<div class='a last'>something here</div>
<div>something here</div>
<div>something here</div>
<div class='a first'>something here</div>
<div class='a'>something here</div>
<div class='a'>something here</div>
<div class='a'>something here</div>
<div class='a last'>something here</div>
<div>something here</div>
<div>something here</div>
<div>something here</div>
<div class='a first last'>something here</div>
</div>
<div class='parent'>
<div>something here</div>
<div class='a first'>something here</div>
<div class='a last'>something here</div>
<div>something here</div>
<div>something here</div>
<div class='a first'>something here</div>
<div class='a'>something here</div>
<div class='a'>something here</div>
<div class='a last'>something here</div>
</div>
As you can see, there are "consecutive blocks" of inner divs which have class a. First div in each block has class first, and last div has class last. Each block is in one parent div (block cannot span on 2 or more parent divs).
Say I click on one of the inner divs which has class a. Is that possible to select only the divs which are in the same block with the clicked div ?
How would you do this ? (If possible, using jQuery.)