fabjoa
fabjoa

Reputation: 1615

jQuery selector equivalent to ~ but reverse

This does not seem to be in the docs of jQuery API, so it probably does not exist, but just wanted to get confirmation from fellow experts.

Is there an equivalent to $('prev ~ next') but for previous siblings? (No methods, just selectors)

Upvotes: 0

Views: 543

Answers (1)

casablanca
casablanca

Reputation: 70731

How about negating the selector?

$('parent > *:not(prev ~ next)')

Working example on JSBin

Upvotes: 2

Related Questions