To get "this" to chain with the .click() method, you need to wrap it in $() so it looks like: $(this)

Better still, don't bother with the .each().

  $("[EMAIL PROTECTED]'button'].button1").click(function(){MyFunc(this);});

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Dec 6, 2007, at 6:36 PM, FrenchiINLA wrote:


I have a javascript function like MyFunc(btn), and I would like to
associate a click event to all my button with button1 class in the
page to this function. I tried the following code and is not working
for me:

   $("[EMAIL PROTECTED]'button'].button1").each(function()
   {
       this.click(function(){MyFunc(this);});
   });

what's wrong with my code? any help would be greatly appreciated.



Reply via email to