Wednesday, May 16, 2012

How do get change value of <input> element?

I have a input in datalist

<input type="text" value="1" id="txtcount">

I want get new value of it when text change.

I use this code but don't work for me .

//look no global needed:)

// Get the initial value
var $el = $('#txtcount');
$'oldVal', $el.val() );

//store new value
var $this = $(this);
var newValue = $'newVal', $this.val());
// Get the value when input gains focus
var oldValue = $(this).data('oldVal');

No comments:

Post a Comment