title: How do you only select the second class an element has in javascript?
body: <p>I am in need of a way to select only the second class on an element that has 2 classes so that I can pass it through an URL to use later. I have created a function that gets both classes but I only need <code>class2</code>. Is their a way to stripe the first class off and have only the second remain. Or is their a way to select only the second class.</p>
  
  <p>I did not find any questions relating to this problem using just vanilla javascript.</p>
  
  <pre><code>&lt;div class="class1 class2&gt;&lt;/div&gt;
  &lt;script&gt;
  
  function get2ndClass(element) {
  
     var secondClass = element.class;
     return secondClass;
  
  }
  </code></pre>