: 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
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
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
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
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
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:
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
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
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
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
10 matches
Mail list logo