title: Return value from input field with the jQuery blur function
body: <p>Goal: User focuses input field. User writes a value in input field. When user is done and the input field isn't in focus anymore, save inserted value to a variable called 'inputFieldValue'. This is should be done invoking the function 'returnInputValue'.</p>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;My test&lt;/title&gt;  
      &lt;/head&gt;
      &lt;body&gt;
  
          &lt;input class="input" /&gt;
  
          &lt;script type="text/javascript" src="jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="test.js"&gt;&lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>test.js</strong></p>
  
  <pre><code>function returnInputValue() {
  
      var inputValue;
  
      $('.input').blur(function() {   
  
          inputValue = $('.input').val();
  
      });
  
      return inputValue;
  
  }
  
  var inputFieldValue = returnInputValue();
  </code></pre>
  
  <p>When I call the variable inputFieldValue variable from the console after having inserted a value and focused out again, it is still 'undefined'. </p>
  
  <p>Have I missed something?</p>