hpy
hpy

Reputation: 2161

Javascript and W3C validity?

I have the impression that the use of javascript often breaks W3C xhtml/css validity. Is this true? If so, why and is there a way for me to use javascript in my webpages and still have them be W3C valid (html, xhtml, css)?

Upvotes: 0

Views: 340

Answers (2)

Mikael Eliasson
Mikael Eliasson

Reputation: 5237

If you wrap your javascript in a //<![CDATA[ tag it will validate

https://developer.mozilla.org/en/properly_using_css_and_javascript_in_xhtml_documents

Upvotes: 3

Vivek Goel
Vivek Goel

Reputation: 24160

The answer of your question is yes. To avoid this read this link http://www.htmlhelp.com/tools/validator/problems.html#script

Upvotes: 3

Related Questions