title: How to determine which button called a function?
body: <p>How would I know which button caused this function to run? Specifically, if I want to set the value of the function to be equivalent to the value of the button?</p>
  
  <pre><code>var foo_button = document.getElementById("foo_button");
  var bar_button = document.getElementById("bar_button");
  foo_button.onclick = foo_or_bar;
  bar_button.onclick = foo_or_bar;
  </code></pre>
  
  <p>Then in a function later on:</p>
  
  <pre><code>function foo_or_bar(){
  
      //this should return the value of the button that was pressed (in this case "foo" 
      //or "bar"
      return button_that_sent_me;
  
  }
  </code></pre>
  
  <p>Is there a way I can detect the value of which button caused this to occur?</p>