g(..).parent([n])

Returns: The .parentNode of nth element from the Gimme Object's internal array.
Params:
  • n, optional (default = 0): Integer value from 0 to g(..).entities.length - 1 (inclusive)

Examples:
// alerts the id of the parent element of #zoo
alert(g('#zoo').parent().id);

// root will be (should be) the <html> element
var root = g(document.body).parent();

// p will be the .parentNode of the 3rd <div> element whose class is "foo" (using .parent(..) in this fashion is rare)
var p = g('div.foo').parent(2);

Last edited Jun 5, 2007 at 4:33 AM by sstchur, version 3

Comments

No comments yet.