This should work then:
$('> span > a', this).html('it works');
--
Brandon Aaron
On 8/28/07, Erik Beeson <[EMAIL PROTECTED]> wrote:
>
>
> > > $(this).children("span").children("a").html("it works");
> > I would have chosen the following
> > $("span a",this).html("it works");
>
> I think that isn'
> > $(this).children("span").children("a").html("it works");
> I would have chosen the following
> $("span a",this).html("it works");
I think that isn't quite the same thing. In the following, your
suggestion would match 3 anchors, and the OP's would just match the
first one:
...
...
...
On 8/28/07, Nico <[EMAIL PROTECTED]> wrote:
>
> $(this).children("span").children("a").html("it works");
>
I would have chosen the following
$("span a",this).html("it works");
~Sean
Also, you could do it XPath style (untested):
$(this).find('/span/a').html('it works');
For more info, check out:
http://docs.jquery.com/DOM/Traversing/Selectors
--Erik
On 8/28/07, Erik Beeson <[EMAIL PROTECTED]> wrote:
> Your last guess is the right idea, but not valid javascript syntax. Ma
Your last guess is the right idea, but not valid javascript syntax. Maybe try:
$(this).find(">span>a").html("it works");
If you just want all of the anchors under 'this', you can do:
$(this).find('a').html(...);
If you know the ID of the element you're looking under, you can do:
$('#container
5 matches
Mail list logo