I have an HTML page, by clicking elements like buttons new DOM elements are appended to my document using jQuery (i.e. $('#foo').append('<div> ... </div>');
). I also remove DOM elements using remove()
.
I'm aware of validator in order to validate my HTML code. But I need to validate also the HTML code created using jQuery. How can I do that? For example I would like to click
a button, see the changed HTML code and validate it and so on ...
I tried using Inspect Element
which shows "live" HTML code. But when copying the code it doesn't copy the backslash (/
), so when using the pasted document to the validator I get a ton of errors saying that /
is missing like this one:
Line 2, Column 69: end tag for "meta" omitted, but OMITTAG NO was specified
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
Although my real source code contains:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
Any ideas on what to do ?