how to get the value from a CSS class object in javascript

Posted by amit on Stack Overflow See other posts from Stack Overflow or by amit
Published on 2010-03-12T21:43:15Z Indexed on 2010/03/12 21:47 UTC
Read the original article Hit count: 281

Filed under:
|
|

I have to select an <a> element from the given class of objects. when i click on the anchor tag in the showcase_URL class, i want the jquery function to get the value from <a> tag. How can this be done?

I cannot make this an id as I am running a while loop to construct all the elements in php. there would be multiple objects of this class. there is no definite selector through which I can get the value of the anchor tag. Help would be much appreciated.

        echo '<div id="content">';  
        echo '<div class="showcase_data">';
        echo    '<div class="showcase_HEAD">'.$row->title.'</div>';
        echo    '<div class="showcase_TYPE">'.$row->type.'</div>';
        echo    '<div class="showcase_date">&nbsp;&nbsp;'.$row->date.'</div>';
        echo    '<div class="showcase_THUMB" style="float: left;" ></div>';
        echo    '<div class="showcase_TEXT">'.$row->details.'</div><br/>';
        echo    '<div class="showcase_URL"><a class="purl" value='.$row->num.'href="'.$row->url.'">PROJECT URL</a></div>';
        echo    '</div>';
        echo    '</div>';

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery