jQuery - how to pass $(this) as an object?

Posted by regan on Stack Overflow See other posts from Stack Overflow or by regan
Published on 2010-05-16T02:18:12Z Indexed on 2010/05/16 2:20 UTC
Read the original article Hit count: 192

Filed under:
|

Hello!

I'm trying to pass an object into a function but think there's a problem with $(this) not actually being valid at the point of passing it in.

$('textarea#quote').live('bind',function(){

}).limit('10',$(this).parents('form').children().find('span#qc') );

The second parameter can be either a string or an object like $('span#qc'), but I also want to be able to pass in an object which references the current one.

Why? Because I have several forms on same page, each containing textarea#quote, so depending on which form is selected I want to be able to reference a particular element within the same form.

Anyone??

© Stack Overflow or respective owner

Related posts about jquery-plugins

Related posts about jQuery