title: jQuery 'enter'-key event handler
body: <p>I'm having a problem using 'enter'-key as an event to append input from 'form' to a list.
  The code below works, but only when I press "cmd+enter" combination, which adds item to my list and opens new tab with the same page.</p>
  
  <p>What I'm willing to achieve is whenever the 'form' field is in focus and I press 'enter'-key (not a 'cmd+enter' combination) the item is added to the list and no new extra tab opens with the same page.
  (I'm testing my code in Firefox 48.0 and Safari 9.1.2)</p>
  
  <p>Here's the html part of the code:</p>
  
  <pre><code>&lt;form id="inputWindow"&gt; Type-in here: &lt;input type='text' name='input'&gt;&lt;/input&gt;&lt;/form&gt;
  </code></pre>
  
  <p>Here's the jQuery part of the code.</p>
  
  <pre><code>$(document).ready(function() {
   $('#inputWindow').keypress(function(event) {
  
  if (event.which == 13){
  var answer = $("input[name=input]").val();
      $('.list').append('&lt;div class="item"&gt;' + answer + '&lt;/div&gt;');
     });
  });
  </code></pre>