title: Get clicked class index javascript
body: <p>I have 3 divs with class: wpEdit and onClick: alertName()</p>
  
  <pre><code>&lt;div class="wpEdit" onClick="alertName()"&gt;Bruce Lee&lt;/div&gt;
  &lt;div class="wpEdit" onClick="alertName()"&gt;Jackie Chan&lt;/div&gt;
  &lt;div class="wpEdit" onClick="alertName()"&gt;Jet li&lt;/div&gt;
  </code></pre>
  
  <p>When clicked i want to know the Index of class wpEdit of the clicked Div:</p>
  
  <pre><code>function alertName(){
      //Something like this
      var classIndex = this.className.index; // This obviously dosnt work
      alert(classIndex); 
  }
  </code></pre>
  
  <p>when clicked on  Bruce Lee it should alert : 0
  when clicked on  Jackie Chan it should alert : 1
  when clicked on  Jet Li it should alert : 2</p>
  
  <p>I need to know which instance of class="wpEdit" is clicked on</p>