This JavaScript function gets the first occurrence of the tag specified in the HTML ancestry of the passed object.
getParentObject(obj, tag)
obj - Required. Handle to an object in HTML object hierarchy.
tag - Optional. String containing the name of the ancestor node used in a search. If not passed, the function returns null.
The first occurrence of the tag specified in the HTML ancestry of the passed object.
This example shows how to code a client-side deletion to run when the user selects a Delete icon in a table row. In this example, element refers to the object that the user selects.
function deleteRow(element) {
var row=getParentObject(element, "TR");
oTable=getParentObject(row, "TABLE");
row.parentNode.deleteRow(row.rowIndex - 1);
fireRowsChanged(oTable);
return false;
}