tags:

views:

38

answers:

3
$textarea.keyup(function(){ update(); });

I tired to add the live funtion to it. Like the following

$textarea.live(keyup(function(){ update(); }));

but i get

Uncaught ReferenceError: keyup is not defined

What am i doing wrong?

+2  A: 
$textarea.live("keyup", function () {
    update();
});
Chinmayee
Thanks. It didn't give a error but still didn't work.I looked up more information and http://stackoverflow.com/questions/1943552/live-for-jquery-elastic-plugin/1943581#1943581 helped me fix the issue.
Keverw
A: 

http://api.jquery.com/live/

Good syntax of .live is .live( eventType, handler ) At least, write it like this : $textarea.live('keyup', update); if you use a real handler or $textarea.live('keyup', function(){update();}); if you only use a function once.

Chouchenos
A: 

try

$textarea.live('keyup',update);

PK

Pavan