How can I select the following (which is created by jquery validate)?
<label class="error" for="location[]">...</label> The CSS Selector
.error[for=location[]] does not work neither
.error[for=location] You need to put attribute value in quotes in selector
.error[for="location[]"] { color:red; } JSFiddle: http://jsfiddle.net/TQ2nN/
You can wrap the attribute value by quotes " as:
.error[for="location[]"] Or use a leading back-slash \ to escape the brackets as:
.error[for=location\[\]] However, you can also use the attribute selector as for^=location.