TextRange.parentElement() (Method)

A reference to an object that is the next outermost item in the document hierarchy.


JScript - 3.0
Internet Explorer - 4.0
Property/method value type:Element object
JavaScript syntax:IEmyTextRange.parentElement()

Having established that a TextRange may correspond to some block of text within the document, this returns a reference to an HTML Element object that fully encloses the TextRange.

For example, if a TextRange was set to bound a couple of Input elements within a Form, this method might return the Form object because that is the next outermost logical object. Of course you could get a TABLE object if the form contained a table with the input elements inside it.