How to set on click button value?
In my html form a set of users each having separate id. The users are auto generated, if new user register means they come into list. Along with that i kept one button as "Invite". But this button id setting for whole users. If I kept on click button alert, it sets for whole users as alert msg.
EX: If John as one user and have id as 5,if i click John's invite button means, for all users the alert is coming. What I need is if John's invite I click means John only has to invited not all users.
How could I compare these user id and button id?
Here is a Code:
<script>
$(document).ready(function(){
$(".InviteTeacher").click(function(){
alert('Invited');
});
});
</script>
<div class="thumb_section bx-def-margin-sec-right">
__thumbnail__
</div>
<div class="button_wrapper">
<input type="button" value="Invite" name="InviteTeacher" class="InviteTeacher" id= "InviteTeacher"/>
</div>
Here thumbnail is a user information.