logo       

[jQuery] Re: what's better?: msg#00503

jQuery

Subject: [jQuery] Re: what's better?


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

Google Custom Search

News | Mail Home | sitemap | FAQ | advertise