I have mulitple textarea’s, when you’re finished editing them i’m looking to retrieve the new text when the field doesn’t have focus anymore.
The solution i’ve been trying is
$('textarea').live('focusout', function() {
console.log(this.text);
});
or
$('textarea').live('blur', function() {
console.log(this.text);
});
Both return as undefined, due to it not knowing what ‘this’ is referring to.
Is there another event that can make this possible?
Use the
valueproperty (this.value) to get the contents. Even in JQuery, the.text()method doesn’t return the right contents of a textarea.If you want to use a JQuery method: