GimmeObject[n]

Description
Retrieves a native DOM element from the GimmeObject's underlying collection.

Params
n, (required): Index of the desired element within the GimmeObject to retrieve

Returns
A native DOM element if one exists at the specified index,
null otherwise

Example

// finds the first <div> element found in the document (or null if no <div> elements are found)
var firstDiv  = Gimme('div')[0];

// finds the first <p> element found in the document (or null if no <p> elements are found)
var firstP = Gimme('p')[0];

// finds the 3rd <span> element that is a descendant of a <p> element (or null if no 3rd <span> descendant of a <p> exists)
var thirdSpan = Gimme('p span')[2];

// finds the element whose id is "foo"
Gimme("#foo)[0]


See Also

Last edited Jul 16, 2010 at 6:42 PM by sstchur, version 3

Comments

No comments yet.