Because $("selector") returns a jquery object which is like an array. It
does not have the standard dom properties on it. To get to the dom node
that was selected you use [0] or .get(0).
For attributes you can use the cross browser attr() method on the jquery
object like this: $("#whoja").attr("src",somevalue)
On Fri, Feb 26, 2010 at 2:34 PM, Roman <[email protected]> wrote:
> On Feb 26, 8:58 am, Frycake <[email protected]> wrote:
> > $("#whoja") is correct but it is a Jquery Object, so you have to reach
> > src on the node
> > $("#whoja")[0].src so
>
> What's the [0] for? $("#whoja") is one element.
>
> --
> You received this message because you are subscribed to the Google Groups
> "jQuery UI" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<jquery-ui%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/jquery-ui?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en.