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