title: how to print entire HTML element in JavaScript?
body: <p>I want to print the entire element including tag name, attribute name/value pairs and innerHTML. How can I do it in JavaScript (jQuery)?</p>
  
  <p>for example:</p>
  
  <pre><code>var elArr = document.getElementsByTagName('link');
  alert(elArr[0].printEntireElement());
  
  //expected output might be 
  &lt;link href="/css/common.css" rel="stylesheet" type="text/css"&gt;`
  </code></pre>
  
  <p>Note that for link element outerHTML is not defined!</p>