lundi 11 juin 2018

Button click does't alert div contents

I have three dynamically generated div. Each contains different data and buttons.On each button click I want to alert the data. I have this. but it only shows the first div data for each button click.

$('.button1').on('click', function(){
 var id = $('.id').val();
 alert(id);
});



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire