SyntaxFix
Write A Post
Hire A Developer
Questions
jQuery(':button').click(function () { if (this.id == 'button1') { alert('Button 1 was clicked'); } else if (this.id == 'button2') { alert('Button 2 was clicked'); } });
EDIT:- This will work for all buttons.