How do find the id of the button which is being clicked?
This is improvement of Prateek answer - event is pass by parameter so reply_click not need to use global variable (and as far no body presents this variant)
function reply_click(e) { console.log(e.target.id); }
B1 B2 B3