I've got a site in which I'm trying to get W3C validated and running
into a few issue with jQuery and I wondered how people worked around
stuff like this:

Here I'm injecting some HTML into my site... 

// append a graphic * to the req'd fields
$('.reqdfield').append('<img src="img/icons/reqdfield.gif" alt="This
field is required" />');

W3C validator complains about:
----------
Line 20, Column 90: document type does not allow element "img" here.
...d.gif" alt="This field is required" />');

The element named above was found in a context where it is not allowed.
This could mean that you have incorrectly nested elements -- such as a
"style" element in the "body" section instead of inside "head" -- or two
elements that overlap (which is not allowed). 
----------


I've also got a few places where I have two form fields, one an
autocomplete field, the other a static select field (I need to provide
this for 508).  I'm doing a show/hide with jQuery depending on if the
user has JavaScript enabled, and the W3C validator complains about the
fields having the same ID...

Just curious how people are working around these type of isses using
things like jQuery?

Thanks,
Jim

Reply via email to