HI WELCOME TO KANSIRIS

Jquery - get the same id in different divs

Leave a Comment
<div class="myClass" data-title="TD_123">Test 1</div>   
<div class="myClass" data-title="TD_123">Test 2</div>       
<div class="myClass" data-title="TD_123">Test 3</div>       


$('.myClass').click(function() {

   var titleValue = $(this).attr('data-title');
   alert(titleValue);

 });

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.