how to use multiple elements, multiple events, but same function in an if statement
<p>Let's say I have: </p>

<p>if (event X happens on element A)
  execute Code R</p>

<p>if (event Y happens on element B)
  execute Code R</p>

<p>In jQuery, instead of the 2 if statements, how do you have 1 if statement whereby:</p>

<p>if (event X happens on element A) OR (event Y happens on element B)
  execute Code R</p>

<p>I've been looking at bind methods but haven't been able to  find the solution to this. It's like Google's search function: If you click on the 'search' button, it executes the search. However, if you type something in the input box and press the 'enter' key, it also executes the search. Again, two different elements (button and input box), two different events (mouse click and key press), but same function (search)?</p>
