This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

parentTextEdit

Property of dom/Elementdom/Element

Syntax

var result = element.parentTextEdit;
element.parentTextEdit = value;

Examples

This example retrieves the parent object, if needed, creates the text range, moves to the original object, and selects the first word in the object.

<SCRIPT LANGUAGE="JScript">
function selectWord()
{
    var oSource = window.event.srcElement ;
    if (!oSource.isTextEdit)
        oSource = oSource.parentTextEdit;
    if (oSource != null) {
        var oTextRange = oSource.createTextRange();
        oTextRange.moveToElementText(window.event.srcElement);
        oTextRange.collapse();
        oTextRange.expand("word");
        oTextRange.select();
    }
}
</SCRIPT>

Notes

Remarks

The property is an object if the parent exists; otherwise, it is null. For example, the parentTextEdit property of the body is null.

Syntax

Attributions