Finding Immediately Adjacent Siblings
Greetings! Here’s a quick tip for advanced filtering of adjacent sibling nodes.
Given the following HTML:
<ul>
<li>Item 1</li>
<li class=”hello”>Item 2</li>
<li class=”hello” id=”three”>Item 3</li>
<li class=”hello”>Item 4</li>
<li>Item 5</li>
<li class=”hello”>Item 6</li>
</ul>
If you needed to select the immediate siblings of #three that matched the class .hello (so the resulting element set would be Item 2, Item 3, Item 4) there […]