Print entire element returned by getElementById
<p>If I'm debugging some javascript code and I want to see where I am in the DOM, how can I print the entire element returned by (say) getElementById()?  I know I can print a field: </p>

<pre><code>attrib = document.getElementById("attrib-2");
alert(attrib.selectedIndex); 
</code></pre>

<p>but if I want to print the whole thing (even children) what can I do?</p>
