Hi,
I want to call user defined function, once <textarea>
attribute values changes.
Attributes like height, width and val() of <textarea>
i.e. on content change.
Your suggestion are welcome!!!
Regards,
-Pravin
Hi,
I want to call user defined function, once <textarea>
attribute values changes.
Attributes like height, width and val() of <textarea>
i.e. on content change.
Your suggestion are welcome!!!
Regards,
-Pravin
Textareas support a change event which fires when the focus leaves the element after the content has changed as well as keyup/down/press events.
You can't reliably detect a change that is triggered by JavaScript, so call whatever functions you would call on change in whatever function makes the change.
This changes on keyup, if you wish to perform a function when the textarea loses focus, change 'keyup' to 'change.'
What you likely want is the change
and keyup
and paste
events, like this:
$("textarea").bind("change keyup paste", function() {
//this executes when the value changes
});