Here I am having two buttons with id frm_submit1 and frm_submit2
<button type="button" id="frm_submit1">Click Me 1!</button>
<button type="button" id="frm_submit2">Click Me 2!</button>
In jquery, I need to do same onclick event for both the buttons. For one button (frm_submit1) click, I used like below. How can I use for multiple buttons?
$(document).on('click', '#frm_submit1', function(event) {
});
I used this, but didn't worked! Any idea?
$("#frm_submit1, #frm_submit2").click(function (e) {
// do something
});
$("#frm_submit1, #frm_submit2"), you achieved the objective of attaching the same onclick handler to the two buttons. So what is it that still doesn't work?onsen-uitag.