[jQuery] Re: jQuery getElementsByName Equivalent ?

2007-09-07 Thread Andy Matthews
: jQuery getElementsByName Equivalent ? Michael Stuhr wrote: 0xCAFE schrieb: Is there a jQuery equivalent for getElementsByName that will return an array ? Thanks! 0xCAFE well id's generally should be only used once per site. that's what they are made for. it's an identificator. what

[jQuery] Re: jQuery getElementsByName Equivalent ?

2007-09-07 Thread Klaus Hartl
Michael Stuhr wrote: 0xCAFE schrieb: Is there a jQuery equivalent for getElementsByName that will return an array ? Thanks! 0xCAFE well id's generally should be only used once per site. that's what they are made for. it's an identificator. what you look for is probably a class He's not

[jQuery] Re: jQuery getElementsByName Equivalent ?

2007-09-07 Thread Andy Matthews
Yes... $('a') Would return an array of all A tags on the page. $('div') Would return an array of all DIV tags on the page. andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 0xCAFE Sent: Friday, September 07, 2007 9:08 AM To: jQuery

[jQuery] Re: jQuery getElementsByName Equivalent ?

2007-09-07 Thread Klaus Hartl
Andy Matthews wrote: Ah...thank you for clarifying Klaus...so he wants all elements that have a name attribute. Yes, that DOM method translates to: document.getElementsByName('foo'); = $('*[name=foo]') // jQuery 1.2, maybe 1.1.4 already $('[EMAIL PROTECTED]') // pre jQuery 1.2 The

[jQuery] Re: jQuery getElementsByName Equivalent ?

2007-09-07 Thread Michael Stuhr
0xCAFE schrieb: Is there a jQuery equivalent for getElementsByName that will return an array ? Thanks! 0xCAFE well id's generally should be only used once per site. that's what they are made for. it's an identificator. what you look for is probably a class so you'd do '$('.myclass')' and

[jQuery] Re: jQuery getElementsByName Equivalent ?

2007-09-07 Thread Glen Lipka
There seems to be two threads with the same question. Repeating answer: Yes, jQuery supports xPath like expressions like: $(div[name=foo]) You can put any attribute/value in there. Its pretty flexible. The 1.2version also has neat variations on this. See detail:

[jQuery] Re: jQuery getElementsByName Equivalent ?

2007-09-07 Thread Gabriel Lovison
but if I put one name for a element, like this: a name= how can I take this element with this name? 2007/9/7, Andy Matthews [EMAIL PROTECTED]: Yes... $('a') Would return an array of all A tags on the page. $('div') Would return an array of all DIV tags on the page. andy

[jQuery] Re: jQuery getElementsByName Equivalent ?

2007-09-07 Thread 0xCAFE
Well, I know ID should be unique and they are, it's just that in the case of an input radio, the name attribute has to be the same for all n radio buttons so they toggle automatically. I was looking for a way to do document.getElementsByName(customerType) and get an array containing all three

[jQuery] Re: jQuery getElementsByName Equivalent ?

2007-09-07 Thread Klaus Hartl
Gabriel Lovison wrote: but if I put one name for a element, like this: a name= how can I take this element with this name? The answer is already in this thread elsewhere, but here's a solution for that special example: $('a[name=]') And that is a basic CSS attribute selector by

[jQuery] Re: jQuery getElementsByName Equivalent ?

2007-09-07 Thread Gabriel Lovison
thank you i forgot this selector :) 2007/9/7, Klaus Hartl [EMAIL PROTECTED]: Gabriel Lovison wrote: but if I put one name for a element, like this: a name= how can I take this element with this name? The answer is already in this thread elsewhere, but here's a solution for that