title: JavaScript: Pressing enter on a text input invoking a function
body: <p><a href="http://codepen.io/abdulahhamzic/pen/YqMQwB" rel="nofollow">http://codepen.io/abdulahhamzic/pen/YqMQwB</a></p>
  
  <p>How do I make it so that when I press enter on a text input, it calls a function? I tried using this:</p>
  
  <pre><code>&lt;input type="text" onkeypress="clickPress()"&gt;   
  </code></pre>
  
  <p>But the problem is I only want pressing enter to call that function, not pressing any key. How do I achieve that?</p>