Sure, just add the other selector separated by a comma like:
$("#button1, #button2").click(function() { })