In my current project I got it again, an itch for a Previous selector. It will be very helpful when you don't have the freedom to fully control your HTML you are working with.

I mean we have next sibling, general sibling and direct child, why can't we have previous child or while we're at it, direct parent. So I want something to complement these…

foo > bar { }
/* child combinators
	<a href="http://www.w3.org/TR/css3-selectors/#child-combinators">spec</a>
*/

foo ~ bar { }
/* general sibling
	<a href="http://www.w3.org/TR/css3-selectors/#general-sibling-combinators">specs</a>
*/

foo + bar { }
/* adjacent sibling selector
	<a href="http://www.w3.org/TR/css3-selectors/#adjacent-sibling-combinators">specs</a>
*/

/* what I want is a previous selector, like this */
foo - bar { }

/* and a parent selector… */
foo &#60; bar

The problem is browsers now, I've been told that it is really hard to implement. So while we are waiting on something that may never come, we might as well work on a make shift solution. I've build on in javascript and put it on Github. It's pretty simple and I'm sure that somebody can improve upon it.

Update

See this article on extending jQuery's selector capabilities too. / thanks to @eising.