title: Get the value of input text when enter key pressed
body: <p>I am trying this:</p>
  
  <pre><code>&lt;input type="text" placeholder="some text" class="search" onkeydown="search()"/&gt;
  &lt;input type="text" placeholder="some text" class="search" onkeydown="search()"/&gt;
  </code></pre>
  
  <p>with some javascript to check whether the enter key is pressed:</p>
  
  <pre><code>function search() {
      if(event.keyCode == 13) {
          alert("should get the innerHTML or text value here");
      }
  }
  </code></pre>
  
  <p>this works fine at the moment, but my question how to get the value inside the text field, I was thinking of passing a reference "this" to the function, or if they had id's then I could use ID's but then I don't see how I could differentiate between which one has been typed, bringing my back to the same problem again...</p>