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 <roman...@gmail.com> wrote:

> On Feb 26, 8:58 am, Frycake <cedricalfo...@gmail.com> 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 jquery...@googlegroups.com.
> To unsubscribe from this group, send email to
> jquery-ui+unsubscr...@googlegroups.com<jquery-ui%2bunsubscr...@googlegroups.com>
> .
> 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 jquery...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-ui+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en.

Reply via email to