That sort of helped, unfortunately I'll have multiple inputs that have
the same name.  And with that code I wouldn't be able to say i have
this DOM object, get me the firstname.  But, it was good to get to
know some more of the syntax.

Ends up the better solution, at least for my case, is just not using
hidden inputs, instead just add attributes called firstName and
anything else i need, then do foo.attr("firstName").

Thanks!

On Mar 26, 2:33 pm, Karl Swedberg <k...@englishrules.com> wrote:
> Just use an attribute selector. For example:
>
> $('input[name=firstName]')
>
> http://docs.jquery.com/Selectors/attributeEquals#attributevalue
>
> --Karl
>
> ____________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Mar 26, 2009, at 10:04 AM, Flavouski wrote:
>
>
>
> > In JQuery I saw you can get attributes by saying
>
> > foo.attr("value"), super handy.
>
> > Is there anyway to get the element of the thing that contains the
> > attribute?
> > Reasoning: I've got a few hidden inputs that have
>
> > name="firstName" value="Bob"
> > name="lastName" value="Bobble"
>
> > So I would want to say get the element whose attr "name" equals
> > "firstName".  So then I can go back into the element and retrieve the
> > value associated with it: "Bob"
>
> > Thanks

Reply via email to