On this Page

    domObj.ancestor

    (Merge only)

    Determine if an object has an ancestor (not necessarily just an immediate parent) of a given name.

    Syntax

    domObj.ancestor(name)

    Returned Value 

    The domObj pointer of the ancestor with the supplied name, or null if no ancestor with that name exists.

    Parameters

    name is a string, which is the name of a, considered by you to be a possible, ancestor of this object.

    Description

    Often a form designer inserts more hierarchy into a form design for various reasons. Script is over 'brittle' if it uses constructs such as this._parent._parent... so as to get the object of some nearby ancestor. By using this ancestor function, coding is both easier and more maintainable.

    See Also

    domObj.childNamed