<span id='span1'>span1</span>
<span>span2</span>
<button id='btn'>select span1</button>
#span1.selected + span {
background-color:red;
}
$('#btn').click(function() {
$('#span1').addClass('selected');
});
I’m using adjacent sibling selector to style checkbox with the custom image, so I don’t want to abandon this selector. Any workarounds?
Well, this is a known bug, see the section about
+selector here: http://www.quirksmode.org/css/contents.html