title: How to get the value of input element on blur of it?
body: <p>I have a input box and a label. I want apply a specific style to the label when there is content in the box. For that I need to get the value typed in it on the blur event so that I can compare it. I tried to write</p>
  <pre><code>&lt;input type=&quot;text /&gt;&quot;
  &lt;label&gt;something&lt;/label&gt;
  $('input').blur(function() {
      $('label').css('color','red');
      console.log($(this).val())
  })
  </code></pre>
  <p>If there is something typed in the input box I should get that value printed in the console. But what I'm getting is an empty value to the console. The color is changing when blur but cannot get value.</p>
  <p>Is there a way to get the value typed and use in the blur event.</p>