title: Formatting [object HTMLElement] to variable string
body: <p>Using this code here to select the clicked on element has console logging anything other than the <code>targetElement</code> produces a <code>[object HTMLElement]</code>. Is there a possible simple method to produce a string result? Javascript or Jquery.</p>
  
  <pre><code>if (document.addEventListener ){
      document.addEventListener("click", function(event){
          var targetElement = event.target || event.srcElement;
          console.log(targetElement);
      });
  } else if (document.attachEvent) {    
      document.attachEvent("onclick", function(){
          var targetElement = event.target || event.srcElement;
          console.log(targetElement);
      });
  }
  </code></pre>