title: DOM Parser giving error on img tag
body: <p>Hi i am trying to parse img using DOM PARSER and it throws parse error for some reason.
  please help me find the solution. As far as i know image tag doesn't need closing tag and browser removes it on load which is creating the parsing issue.</p>
  
  <p><img src="https://i.stack.imgur.com/rplgC.png" alt="enter image description here"></p>
  
  <p><strong>Fiddle:</strong></p>
  
  <p><strong><a href="http://jsfiddle.net/ygR4L/" rel="nofollow noreferrer">http://jsfiddle.net/ygR4L/</a></strong></p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;body&gt;
      &lt;img src="test"&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;body&gt;
      &lt;img src="test"/&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;body&gt;
      &lt;img src="test"&gt;&lt;/img&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>javascript:</strong></p>
  
  <pre><code>var html = document.body.innerHTML;
  function parseXML(html)
  {
      var parser, componentDoc;
      if (window.DOMParser)
      {
          parser = new DOMParser(); // should work for FF and IE 9
          componentDoc = parser.parseFromString(html,"application/xhtml+xml");//this line must be creating the issue. which mime type is better 
      }
      else
      {
          componentDoc = windowsParse(html);
      }
      return componentDoc;
  } 
  
  var component = parseXML(html);
  console.log(component);
  </code></pre>