Jump to content

validation and prototype


S Murder

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...