[jQuery] Help finding parent element

2006-09-23 Thread Bruce McKenzie
What's the preferred/simplest way to get hold of the immediate parent of a DOM element? I've got a table in which some cells are editable (I'm using the excellent editable plugin by Dylan Verheul). When a cell is changed, the database gets updated and the Ajax callback needs to recalculate the

Re: [jQuery] Help finding parent element

2006-09-23 Thread Rey Bango
I'm just getting into the ins and outs of JQuery but I believe you can use the .parent() method to do that. Something like this: $("p").parent() HTH. Rey... Bruce McKenzie wrote: > What's the preferred/simplest way to get hold of the immediate parent of > a DOM element? > > I've got a table i

Re: [jQuery] Help finding parent element

2006-09-23 Thread Glen Lipka
Parent() works, and also xPath expressions: (damn, jquery has so much power on traversal)refer to: http://jquery.com/docs/Base/_expression_/XPath/Example: $("../",this) should get the parent too. It actually would really help "Getting Started" if someone would write a bunch (like 100) of common tra

Re: [jQuery] Help finding parent element

2006-09-24 Thread George Adamson
Good point about using $("../",this) as an alternative to using $(this).parent(), though I've noticed that the syntax should be $("..",this) to return the parent, while $("../",this) returns siblings. Does this sound right? Cheers, George Adamson Glen Lipka wrote: > > Parent() works, and also

Re: [jQuery] Help finding parent element

2006-09-26 Thread Blair McKenzie
I liked this traversal examples idea, so I put some basic ones I've used in the jQuery cookbook to get it started. Could probably use some more 'interesting' examples :D. BlairOn 9/24/06, Glen Lipka <[EMAIL PROTECTED]> wrote: Parent() works, and also xPath expressions: (damn, jquery has so much pow