title: Get Class Name of Element from MouseEvent Target
body: <p>I need the class name of an <code>EventTarget</code>, which I'm getting like this:</p>
  
  <pre><code>&lt;div class="orig-post" (mousemove)="onMouseMove($event)"&gt;&lt;/div&gt;
  
  onMouseMove(event: MouseEvent): void {
      this.target = event.target
      console.log(this.target) // Outputs the element the mouse is currently over
  }
  </code></pre>
  
  <p>I'd like to be able to assign a variable to the class name of the element that is the target. If I were using something like <code>getSelection()</code> I could just do something like <code>selection.anchorNode.parentElement.className</code>. Is there a way to do this in pure javascript? I'm using Angular 2 and would like to avoid jQuery entirely.</p>