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 radio buttons in order to check if one is checked.

Glen Lipka answer is good, I will use the $
("input[name=customerType]").

Thanks!
0xCAFE

On Sep 7, 11:47 am, Michael Stuhr <[EMAIL PROTECTED]> 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
>
> so you'd do '$('.myclass')' and you'll get that elements who have a
> class of 'myclass' as an array.
>
> additionally there are other ways to achieve this, eg. if there is no
> such class.
>
> look here:http://docs.jquery.com/DOM/Traversing
>
> micha

Reply via email to