How handle an element of elements having same class name using jquery -
<div id="user" class="user">akhilreddy</div> <div id="user" class="user">subodh</div> i many of elements showing two, when ever click on div want text inside div diplayed in alert box.
thank
$('body').on('click', '.user', function() { alert($(this).text()); }); http://jsfiddle.net/samliew/rweea/
you should remove duplicate ids.
Comments
Post a Comment