GimmeObject.parent([n])

Description
Returns a GimmeObject wrapping the parent of the element specified at the index from the GimmeObject's underlying collection.

Params
n, (optional / default = 0): Index of the element within the GimmeObject whose parent DOM element is desired.

Returns
A GimmeObject wrapping a parent of some element from within the original GimmeObject's underlying collection, or,
An Empty GimmeObject if no parent element was found.

Example

// returns a GimmeObject wrapping the parent of the first <div> element found in the document.
var gim  = Gimme('div').parent();

// returns a GimmeObject wrapping the parent of the first <p> element found in the document.
var gim = Gimme('p').parent(0);

// returns a GimmeObject wrapping the parent of the 3rd <span> element that is a descendant of a <p> element.
var gim = Gimme('p span').parent(2);

// returns a GimmeObject wrapping the parent of the element whose id is "foo"
var gim = Gimme("#foo).parent()


See Also
  • TODO

Last edited Jul 20, 2010 at 8:02 PM by sstchur, version 3

Comments

No comments yet.