I've got several buttons that look like:
<span class="input-group-btn">
<a class="btn btn-default" href="#">
<i class="fa fa-barcode"></i> Scan
</a>
</span>
But I need to be able to detect which of the x number of buttons has been pressed. Is there any way I can do that with JQuery/JavaScript?
The buttons are created dynamically like:
$('input[role="barcode"]').before('<span class="input-group-btn"><a class="btn btn-default" href="#"><i class="fa fa-barcode"></i> Scan</a></span>')
As an alternative is it possible to give each button a different id or href to differentiate between them on creation?
<button>...</button>