|
[jQuery] Re: what's better?: msg#00503jQuery
Well, the second version won't help very much since you are not reusing "myEL" later on On Mar 4, 9:36 am, hcvitto <hcvi...@xxxxxxxxx> wrote: > hi > just needed an advice... > what' s better between this two (if there's any difference at all): > > this: > > $('a[class^=open]').click(function(){ > ...whatever... > > }); > > or this: > > var myEl = $('a[class^=open]'); > $(myEl).each(function(){ > $(this).click(function(){ > ...whatever... > }); > )}; > > thanks > Vitto
|
|
||||||||||||||||||||||||||
|
|
|
| News | Mail Home | sitemap | FAQ | advertise |