title: Using multiple buttons on same function that redirects to different functions
body: <p>So..i'm having this problem for couple of days not knowing how to do this,and i need help.</p>
  
  <p>I have multiple buttons and clicking all of them is redirecting me to same function and from that function is going to another function specified for that button. 
  Any idea how can i go true couple of functions knowing which button is clicked?
  example :</p>
  
  <pre><code> &lt;html&gt;
  
  &lt;button type="button" onclick="myFunction()" id="1"&gt;Button1&lt;/button&gt;
  &lt;button type="button" onclick="myFunction()" id="2"&gt;Button1&lt;/button&gt;
  &lt;button type="button" onclick="myFunction()" id="3"&gt;Button1&lt;/button&gt;
  
  &lt;script&gt;
  
  function myFunction()
  {
     var x=0;
  
      if (button 1){
       x=1;
       myFunction1(x);}
  
     if (button 2){
      x=2;
      myFunction2(x);}
  
      if (button 3){
       x=3;
       myFunction3(x);}
  
       ...
      myFunction3(x){
      alert(x);
  }
  }
  
  &lt;/script&gt;
  
  &lt;/html&gt;
  </code></pre>