I have following buttons in my table
<td><Button id="approval_<?php echo $i; ?>" type="submit" class="myclass btn success trr" ><span>Approve</span> </button>
</td>
<td><Button id="approval_<?php // echo $i; ?>" type="submit" class="smyclass btn failed trr" ><span>Deny</span> </button>
</td>
I need to make a onclick action
some thing like this
$('.myclass').click(function() {}
problem is that how do I tell which button was clicked?
Inside the click function, you can reference the element the action was performed on by using $(this).
So:
Quick note – you’re going to want to cache $(this). This way, you can reference it as many times as you want, but will only perform the DOM lookup once.
As in: