The HTML validator looks at the page's Doc Type, usually the very first line of code in the page's HTML.

The Doc Type is a statement of which standard the document is supposedly following.

amperstand not validating javascript w3c-70

For bonus points, you could try to eliminate any warnings as well.

As you fix your markup to remove one error, you may find that you generate more-- or that suddenly several other errors go away.

Here’s a little guide to help clear up that If you’re using a web framework that escapes variables for you and you pass in a url as a variable into javascript, then you’ll have to make sure it doesn’t encode the ampersands.

In Django, you would write something like this: Nice summary.

encoding them, stuff can get dicey in weird edge cases and fail completely in XML.

This seems like a simple rule, but what about urls in HTML, javascript files, javascript in HTML, etc…How do the W3C's validators decide which technical standard to use?The HTML validator and the CSS validator differ in this respect.An often used validator is the World Wide Web Consortium's HTML Validator.It's provided by the same people who are responsible for the HTML specification, and more importantly most of its error messages provide a link to an explanation of what the error means.If you are not careful, you risk building your web pages on assumptions of browser behavior, that were never intentional, never documented and likely to not hold in the future.