How do get change value of <input> element?
<p>I have a input in datalist</p>

<pre><code>&lt;input type="text" value="1" id="txtcount"&gt;
</code></pre>

<p>I want get new value of it when text change.</p>

<p>I use this code but don't work for me .</p>

<pre><code>&lt;script&gt;
//look no global needed:)

$(document).ready(function(){
    // Get the initial value
   var $el = $('#txtcount');
   $el.data('oldVal',  $el.val() );


   $el.change(function(){
        //store new value
        var $this = $(this);
        var newValue = $this.data('newVal', $this.val());
   })
   .focus(function(){
        // Get the value when input gains focus
        var oldValue = $(this).data('oldVal');
   });
});
</code></pre>

<p></p>
