javascript - Fire Function if Button or Other Button Is Clicked -


this obvious, because it's hard describe, can't find through searching.

i want if user clicks on of several buttons, 1 event gets triggered. possible? i've tried, doesn't appear work:

$("#button1" || "#button2").click(function() {alert("example")});

try this:

$("#button1, #button2").click(function() {alert("example")}); 

http://api.jquery.com/multiple-selector/


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -