[jQuery] Re: Difference between element and # access

2007-06-29 Thread Dan G. Switzer, II
>Which of these would be faster? > >$("#myForm").each(function(frmI,frm){ > $("input.classA",frm)... > $("input.classB",frm)... > $("#inputC",frm)... >}); > >or > >$("#myForm input.classA")... >$("#myForm input.classB")... >$("#inputC")... The 2nd set definitely does a lot less

[jQuery] Re: Difference between element and # access

2007-06-29 Thread traunic
Which of these would be faster? $("#myForm").each(function(frmI,frm){ $("input.classA",frm)... $("input.classB",frm)... $("#inputC",frm)... }); or $("#myForm input.classA")... $("#myForm input.classB")... $("#inputC")... On Jun 27, 2:03 pm, "John Resig" <[EMAIL PROTECTE

[jQuery] Re: Difference between element and # access

2007-06-29 Thread Diego A.
I thought it would. How could I think otherwise. Sorry John ;-) On Jun 27, 7:03 pm, "John Resig" <[EMAIL PROTECTED]> wrote: > They're both just as fast as each other - jQuery has an optimization > in place to account for that. > > Terry: I assume that you mean "div#TimelineContainer" in your firs

[jQuery] Re: Difference between element and # access

2007-06-28 Thread Karl Swedberg
Hey, no worries. I understand the motivation was good. :) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jun 27, 2007, at 4:48 PM, Terry B wrote: sry man, i wasnt meaning to get on ya... i wanted to just to point it out cause some ppl really dont kno

[jQuery] Re: Difference between element and # access

2007-06-27 Thread Terry B
sry man, i wasnt meaning to get on ya... i wanted to just to point it out cause some ppl really dont know and i would luv to see the developers actually enforce it and not make it easy to be lazy :D so, again sorry... On Jun 27, 4:12 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > Yes, of cour

[jQuery] Re: Difference between element and # access

2007-06-27 Thread Karl Swedberg
Yes, of course, Terry. I didn't mean to suggest that having multiple IDs is a good idea. I was just noting that the ID selector $('#TimelineContainer') will not select "any" element with that ID. It will only find one -- even if someone wrongly has more than one element with the same ID.

[jQuery] Re: Difference between element and # access

2007-06-27 Thread Terry B
The whole point of having an ID is to have a unique id. You should not be assigning the same ID name to multiple objects. Use classes if you want to handle multiple objects. http://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html#adef-id id = name [CS] This attribute assigns a name t

[jQuery] Re: Difference between element and # access

2007-06-27 Thread Karl Swedberg
On Jun 27, 2007, at 2:02 PM, Ganeshji Marwaha wrote: the second one [ $t("#TimelineContainer") ] will select any element with an id of "TimelineContainer" Quick clarification. This will only select the first one it finds in the DOM. To find any element with an id of "TimelineContainer," we'

[jQuery] Re: Difference between element and # access

2007-06-27 Thread Terry B
yea already been testing the methods and going from div.[name] to #[name] took my script from 70s to 16s. i also tested using the document.getElementById('[name]') and there was no difference between that and using #. no more div.[name] for me On Jun 27, 1:57 pm, "Diego A." <[EMAIL PROTECT

[jQuery] Re: Difference between element and # access

2007-06-27 Thread John Resig
They're both just as fast as each other - jQuery has an optimization in place to account for that. Terry: I assume that you mean "div#TimelineContainer" in your first example. --John On 6/27/07, Diego A. <[EMAIL PROTECTED]> wrote: I'm not sure, but I'm guessing there will be some sort of per

[jQuery] Re: Difference between element and # access

2007-06-27 Thread Ganeshji Marwaha
the first one will find all the "div" elements with a class name of "TimelineContainer". the second one will any element with an id of "TimelineContainer" -GTG On 6/27/07, Diego A. <[EMAIL PROTECTED]> wrote: I'm not sure, but I'm guessing there will be some sort of performance difference. I'

[jQuery] Re: Difference between element and # access

2007-06-27 Thread Diego A.
I'm not sure, but I'm guessing there will be some sort of performance difference. I'm guessing '#id' is faster than 'div#id' if '#id' just uses getElementById, whereas 'div#id' might finds all divs then filter by id. On Jun 27, 5:46 pm, Terry B <[EMAIL PROTECTED]> wrote: > what is the difference