title: Call difference function with difference input while pressing enter
body: <p>html</p>
  
  <pre><code>text1:&lt;input type="text" id="text1"/&gt;
  &lt;br&gt;
  &lt;br&gt;
  text2:&lt;input type="text" id="text2"/&gt;
  &lt;br&gt;
  &lt;br&gt;
  text3:&lt;input type="number" id="text3"/&gt;
  </code></pre>
  
  <p>js</p>
  
  <pre><code>window.onkeydown = onKeyDownHandler;
  
  function onKeyDownHandler(e)
  {
      switch (e.keyCode) {
            case 13:
              if(text1){
              alert("text1 function");
              }else if(text2){
              alert("text2 function");
              }else if(text3){
              alert("text3 function");
              }
            return;
      }
  }
  </code></pre>
  
  <p>I have 3 input fields which I want to do difference function while pressing enter. How do I get or detect which input field I am on? Is there some way I can check the id name when I click on the input field (focus), then somehow match the id name with in onKeyDownHanlder function case?</p>
  
  <p><a href="https://jsfiddle.net/Tedeee/61skufox/1/" rel="nofollow">Demo</a></p>
  
  <p>Something like this</p>
  
  <pre><code>if(focusidname = text1){
  alert("text1 function");
  }
  </code></pre>