onclick pass class of element to javascript
<p>i wrote a code like this</p>

<pre><code>&lt;?php
$extCount = 0;
foreach($this-&gt;externalReferal as $externalReferal)
{
$extCount++;
?&gt;

    &lt;div class='fieldtestPct' &gt;
      &lt;div class='fieldItemLabel'&gt;
                &lt;label for=''&gt;&lt;?php echo $externalReferal-&gt;getConsultantname(); ?&gt; ( &lt;?php echo $externalReferal-&gt;getSpeciality(); ?&gt; )&lt;/label&gt;
      &lt;/div&gt;
        &lt;div class='fieldItemValue'&gt;
                &lt;input type='checkbox' class='ext_ref_list&lt;?php echo $extCount; ?&gt;' name='ext_ref_cons[]' value="Consultant&lt;?php echo $extCount ?&gt;" &gt;
         &lt;/div&gt;
    &lt;/div&gt;

&lt;div class='fieldtestPct'&gt;
      &lt;div class='fieldItemLabel'&gt;
                &lt;label for=''&gt;Current Visit&lt;/label&gt;
      &lt;/div&gt;
        &lt;div class='fieldItemValue'&gt;
                &lt;input type='checkbox' class='current_visit&lt;?php echo $extCount; ?&gt;' name='current_visit[]' value="" onClick ='currentVisit(this.class)'&gt;
         &lt;/div&gt;
    &lt;/div&gt;
&lt;div class='fieldtestPct'&gt;
      &lt;div class='fieldItemLabel'&gt;
                &lt;label for=''&gt;Full Data&lt;/label&gt;
      &lt;/div&gt;
        &lt;div class='fieldItemValue'&gt;
                &lt;input type='checkbox' class='full_data&lt;?php echo $extCount; ?&gt;' name='full_data[]' value="" onClick='fullData(this)'&gt;
         &lt;/div&gt;
    &lt;/div&gt;

                &lt;div class='clear'&gt;&lt;/div&gt;
&lt;?php
}
?&gt;
</code></pre>

<p>Here i need to do dynamic action on click of checkboxes. how do i pass the selected element class/data to javascipt .</p>
