Jump to content

validation and prototype


S Murder
 Share

Recommended Posts

If I use JavaScript to extend HTML elements with .prototype to add new attributes to them, will my page still validate as valid XHTML? I've noticed before that if I insert non-XHTML elements into my document using JS after the page has loaded, it will still validate. Is it the same thing here, where if I extend and use the additional attributes entirely in JS it will still validate?

Link to comment
Share on other sites

yes it will still validate as the w3c validator doesn't not execute the javascript code to get teh extra html content. It only looks at the static HTML of the page.I think Firefox or Opera will validate it or at least let you see the extra html that js generates also so you can validate it. It s a good idea to generate valid code with javascript so that it functions as expected in each browser.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...