g(..).getHTML(n)

Retrieves the .innerHTML of the nth element in the Gimme Object's internal array.

Returns: The .innerHTML of the nth element in the Gimme Object's internal array.
Params:
  • n, optional (default = 0): an integer value between 0 and g(..).length - 1 inclusive, which specifies index of the element whose .innerHTML is to be returned.

Examples:
// retrieves the .innerHTML of the first <p> element that has the class "happy"
var html = g('p.happy').getHTML();

// retrieves the .innerHTML of the element whose id is #someElem
var html = g('#someElem').getHTML();

// retrieves the .innerHTML of the fifth <div> element on the page
var html = g('div').getHTML(4);



Last edited Jun 8, 2007 at 4:24 AM by sstchur, version 1

Comments

No comments yet.