That doesn’t do the same, notably the + combinator is the direct sibling, so if you throw another <div> in the middle with a different class it breaks.
Yes i know. But both solutions have caveats since even with the subsequent sibling the code will break if you use another element type (because you are bound to type of the element).
BTW, nice exploration, thank you :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
That doesn’t do the same, notably the + combinator is the direct sibling, so if you throw another
<div>
in the middle with a different class it breaks.Yes i know. But both solutions have caveats since even with the subsequent sibling the code will break if you use another element type (because you are bound to
type
of the element).BTW, nice exploration, thank you :)