29 May
2009
29 May
'09
9:03 p.m.
So just to clarify, will the context always refer to a single element? In other words should my code be: $elem = $(context).get(0); do_my_behavior($elem); or, more like: $(context).each(function () { $elem = $(this).get(0); do_my_behavior($elem); }); And in the first invocation, when context == document, will $(document).get(0) return the document? Thanks everyone for helping me understand. -Dave On Fri, 29 May 2009 11:44 -0700, "Earl Miles" <merlin@logrus.com> wrote:
I totally disagree. It's either a jquery object or something you can easily make into a jquery object. Using $(context) should always work and you can get a DOM element using $(context).get(0). Ignoring context will lead to poor performance.