.html() only gets the innerHTML for the first matched element. What
are you trying to do with the children?
--John
On 9/12/07, Brook Davies [EMAIL PROTECTED] wrote:
Hello,
I am trying to simply grab the children of a div. The markup is:
div id=content
div
On Sep 12, 9:20 pm, John Resig [EMAIL PROTECTED] wrote:
.html() only gets the innerHTML for the first matched element.
i think that's what the OP is saying: the element's HTML he's getting
back is *not* that of the first child element:
div id=content
div
On 9/12/07, Stephan Beal [EMAIL PROTECTED] wrote:
On Sep 12, 9:20 pm, John Resig [EMAIL PROTECTED] wrote:
.html() only gets the innerHTML for the first matched element.
i think that's what the OP is saying: the element's HTML he's getting
back is *not* that of the first child element:
On Sep 12, 10:52 pm, Richard D. Worth [EMAIL PROTECTED] wrote:
as John pointed out, html() returns innerHTML, not outer, so div
id=panelPreview... should only be expected if $('#content').html() were
called.
Doh, of course.
/me smacks forehead.
I have been playing around with this.
http://www.commadot.com/jquery/selectorChildren.php
It's interesting to me how text and html act differently in terms of
encoding and what actually shows up.
It's also interesting to see how text nodes and a div are treated.
I am confused. Why aren't the
parent is to children
as
parents is to find(*)
That's the rough equivalence in jQuery.
--John
On 9/12/07, Glen Lipka [EMAIL PROTECTED] wrote:
I have been playing around with this.
http://www.commadot.com/jquery/selectorChildren.php
It's interesting to me how text and html act differently
On 9/12/07, Glen Lipka [EMAIL PROTECTED] wrote:
I am confused. Why aren't the grandchildren being included in the call
for children()?
Using $(#content *) gets all the grandkids. I thought parents() gets
all the grandparents. Is children different?
$(#content).children() is equivalent to
Shouldn't it be child() and children() if we have parent() and parents()?
I feel like we are mangling plural/singular rules.
Glen
On 9/12/07, Richard D. Worth [EMAIL PROTECTED] wrote:
On 9/12/07, Glen Lipka [EMAIL PROTECTED] wrote:
I am confused. Why aren't the grandchildren being
On Sep 12, 2007, at 5:50 PM, Glen Lipka wrote:
Shouldn't it be child() and children() if we have parent() and
parents()?
I feel like we are mangling plural/singular rules.
I don't think so. As Richard pointed out, you can have more than one
direct child (one level down) but you can only
:[EMAIL PROTECTED] On
Behalf Of John Resig
Sent: September 12, 2007 12:21 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: NEWBIE Question: children() skips first element?
.html() only gets the innerHTML for the first matched element. What
are you trying to do with the children?
--John
On 9/12
10 matches
Mail list logo