Waseem Senjer
Waseem Senjer

Reputation: 1048

How to get new value from textarea after firing "Change" event?

I'm trying to get the new value of textarea by using jQuery event "change" :

jQuery('#content').change(function(){

    alert(jQuery(this).html());

});

But whenever I change the content of the textarea, I always get the old value as a result.

Here is the example on JSFiddle : http://jsfiddle.net/k4zKp/

Upvotes: 0

Views: 703

Answers (1)

Ted
Ted

Reputation: 4166

try

jQuery('#content').change(function(){

    alert(jQuery(this).val());

});

Upvotes: 2

Related Questions