title: this.class vs. this.getAttribute('class')
body: <p>I have a radio button, and when it is pressed a function is called, which accepts the class of the button as an argument. So something like this:</p>
  
  <pre><code>&lt;input class="myclass" type="radio" name="name" value="x" checked="true" onClick="myFunction(this.value, this.getAttribute('class'))"&gt;&lt;/input&gt;
  </code></pre>
  
  <p>Notice that in my onClick, I have <code>this.getAttribute('class')</code> instead of simply <code>this.class</code>. I tried using this.class but I kept getting <code>undefined</code>. Is <code>this.class</code> not an acceptable thing to do? I have used <code>this.id</code> elsewhere in my code which works fine, but for some reason I need to use <code>getAttribute</code> when I want to reference class. </p>
  
  <p>So essentially I am asking what is the difference between <code>this.class</code> and <code>this.getAttribute('class')</code>?</p>