I\'m using jQuery validation.
When for is now valid, validator is creating those:
Using the (CSS2) attribute selector:
.error[for="username"]
This will work in IE8+ and all modern browsers.
IE7's attribute selector is buggy: as explained here, to match for you must use htmlFor.
So, if you need IE7 support, use this:
.error[for="username"], .error[htmlFor="username"]
Thanks IE7, for making my answer over twice as long as it needed to be.