title: Pass HTML value to JavaScript function called by multiple buttons
body: <p>I have a function called by a bunch of buttons, and I would like to be able to tell which button has called the function. So that I can change the value of an input field based on which button was clicked.</p>
  <pre><code>&lt;input id=&quot;input&quot; type=&quot;text&quot;&gt;
  &lt;button type=&quot;button&quot; id=&quot;button00&quot; onclick=&quot;name()&quot; value=&quot;0&quot;&gt;0&lt;/button&gt;
  &lt;button type=&quot;button&quot; id=&quot;button01&quot; onclick=&quot;name()&quot; value=&quot;1&quot;&gt;1&lt;/button&gt;
  
  let input = document.getElementById(&quot;input&quot;);
  function name() {
      input.value = input.value + buttonValue
  }
  </code></pre>