We'd really need to see your HTML code, but if you want to get the parent of
an object.

Let's  say you have HTML code like this:

<div>
        <p>
                <b>this is my paragraph</b>
        </p>
</div>

You want to get the immediate parent of all P tags:

$('p').parent();

or you want to get a div that is a parent higher up in the chain:

$('p').parent('div');



-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of noon
Sent: Thursday, April 03, 2008 8:55 AM
To: jQuery (English)
Subject: [jQuery] new to jquery


Hello, i've been writing javascript for a while now.  So, as you can imagine
I am struggling just a bit.  I browsed a few of the beginner tutorials and
didn't see what I was looking for.  I understand that methods like .is or
.hide are special to the jquery library and you can't access these using
regular DOM elements.  But I don't want to type
$(this.parentNode.parentNode) every time I want to do something to it.
Assigning var target = $(this.parentNode.parentNode); still doesn't let me
use jquery methods against target.

Can someone point me in the right direction here?


Reply via email to