[jQuery] Re: class keyup() get id

2008-06-11 Thread iam_peter
thanks, this is the way out.

[jQuery] Re: class keyup() get id

2008-06-11 Thread Richard D. Worth
$(function(){ $('.comment').keyup(function(ev){ var textarea = $(this); var id = textarea.attr('id'); }) }); The context 'this' in jQuery callbacks is always a DOMElement and always corresponds to the element to which the event is bound. You could also get it from ev.target in this ca