title: how to delay keypress enter
body: <pre><code>window.addEventListener('keydown', function(event) {
       onKeyDownHandler(event);
  }, false);
  
  
  function onKeyDownHandler(e)
  {
      var focus_id = e.target.id;
      switch (e.keyCode) {
            case 13: // enter
            if(focus_id == "Text1")
            {
              alert("function 1");
            }else if(focus_id == "Text2")
            {
              alert("function 2");
            }else if(focus_id == "Text3")
            {
              alert("function 3");
            }
            return;
      }
  }
  </code></pre>
  
  <p>is there anyway i can delay or make sure user dont spam by clicking the enter , how do i set keypress delay on my enter button ? which is the best way set delay timer or remove EventListener?</p>