I have this code:
$("#leftbutton").click(function(e){
/// do xyz
});
$("#rightbutton").click(function(e){
/// do xyz (same thing)
});
How do I combine them so that if you click #leftbutton or #rightbutton it does xyz?
Something like this:
$("#leftbutton OR #rightbutton").click(function(e){
/// do xyz
});
Use the comma, also known in the jQuery docs as the multiple selector: