jQuery 1.9 attr() no longer returns current input value and instead returns old (default) input value

jQuery 1.9 attr() no longer returns current input value and instead returns old (default) input value

It appears that under jQuery 1.9, the .attr() method no longer returns the current input value and instead returns the old or default value no matter what changes have been made to the value of the input.  Under jQuery 1.8, this code works as expected with the current value of input being returned by attr().  As a work-around, one can extract the current value of input directly from the DOM (see example for both methods).

Am I doing something wrong, or is this the way jQuery 1.9 is supposed to work?  When trying the example below, be sure to change the value and see what the response is on the console when you cause a blur event by hitting tab or clicking outside the input box.

Any advice or insight would be much appreciated.

  1. <script>
  2. var handleBlur = function(elt) {
  3. console.log( 'element value via jQuery for ' + $(elt).attr('id') + ' is ' + $(elt).attr('value') );
  4. console.log( 'element value via javascript (not jquery) is ' + elt.value );
  5. console.log( 'elt is ' );
  6. console.log( elt );
  7. } // END handleClick
  8. </script>
  9.     
  10.         <form><input id='fred' name='fred' type='text' onblur='handleBlur(this)' value='current value' /></form>