There are many elements with one CSS class. How to choose the item on which the page visitor clicked? Example:
HTML:
<div class="class"> <a id="aclass">клик</a> </div> <div class="class"> <a id="aclass">клик2</a> </div>
Javascript:
$('.class').click(function() { var link = $('.aclass',this).text(); alert(link); });
This code is probably wrong, since it does not work.