Does anyone know how to wrap the inner error string in a span? I\'m using the jQuery Validate plugin for my form and getting the default error message displaying in label tags,
Use the errorElement option to wrap each item in a span
.
Then use the wrapper option to enclose each span
within a label
$('#myform').validate({
errorElement: 'span',
wrapper: 'label'
....
Will give you...
For CSS & jQuery targeting, you don't need a special class
as you can select like this...
label > span
OR more specifically...
label > span.error
DEMO: http://jsfiddle.net/s89ommhx/