Click to return to the DHTML, HTML     
parentStyleSheet Property     parentWindow Property     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

parentTextEdit Property


Retrieves the container object in the document hierarchy that can be used to create a textRange containing the original object.

Syntax

HTMLN/A
Scripting[ oObject = ] object.parentTextEdit

Possible Values

oObjectObject that specifies the supported text ranges.

The property is read-only with no default value.

Remarks

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

Example

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.

Sample Code

<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>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BDO, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, custom, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, HEAD, Hn, HR, HTML, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, INS, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, META, NEXTID, NOBR, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XMP


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.