jQuery: is element.click(func) or element.attr('onlick','func()') more efficient?

Posted by Jake on Stack Overflow See other posts from Stack Overflow or by Jake
Published on 2010-04-29T04:56:00Z Indexed on 2010/04/29 4:57 UTC
Read the original article Hit count: 421

I'm populating a list by cloning elements into it. Then I change attrs to make each item unique. They need to call a function on click, so I'm wondering if it's more efficient to use new_element.click(func); or new_element.attr('onlick','func();');

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-event-binding