Select Siblings $("prev ~ siblings")

$("prev ~ siblings")

e.g. $("div ~ p")

$("prev ~ siblings") selects all siblings elements matching siblings selector preceded by sibling prev element matching prev selector.

For example, $("div ~ p") will find all <p> elements that follow after <div>.
<div>div</div>
<p>p1</p>
<span>span</span>
<p>p2</p>
Note: $("div + p") will find adjacent <p> that follow after <div>.
<div>div</div>
<p>p1</p>
<span>span</span>
<p>p2</p>

Code: Find all siblings square class="square" that follow after prev cirlce class='circle'

HTML
//CSS classes
.circle{ ... }
.square{ ... }
.rectangle{ ... }

<div class="circle">circle</div>
<div class="square">square</div>
<div class="square">square</div>
<div class="rectangle">rectangle</div>
<div class="square">square</div>
jQuery code
$(".circle ~ .square"); // selects sibling squares that come after sibling cirlce
Demo

circle
square
square
rectangle
square
jQuery selector $("prev ~ siblings")