outerText
Properties Reference

outerText

Description

Sets or retrieves the text of the current element.

Syntax

object.outerText[ = outerText]

Settings

This read-write property can be any valid string. When setting this property, the given string completely replaces the original text in the element, except for <html>, <head>, and <title> tags.

Note You cannot set this property while the document is loading. Wait for the onload event before attempting to set it. If a tag is dynamically created using TextRange, innerHTML, or outerHTML, you can only use JScript to create new events to handle the newly formed tags. VBScript is not supported.

Applies To

A, ACRONYM, ADDRESS, APPLET, AREA, B, BGSOUND, BIG, BLOCKQUOTE, BR, BUTTON, CENTER, CITE, CODE, COMMENT, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IFRAME, IMG, INPUT, INS, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, OBJECT, OL, P, PLAINTEXT, PRE, Q, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, XMP

See Also

insertAdjacentText method


overflow

Description

Sets or retrieves the CSS overflow attribute for the element.

Syntax

object.overflow[ = overflow]

Remarks

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

style

CSS Attribute

overflow


owningElement

Description

Returns the element that is next in the HTML hierarchy. This will usually contain the STYLE or LINK element that defined the style sheet.

Syntax

object.owningElement

Remarks

This property has read-only permission, meaning you can retrieve its current value, but not change it.

Applies To

styleSheet


padding

Description

Returns the CSS padding attribute.

Syntax

object.padding[ = padding]

Remarks

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

style, FIELDSET, LEGEND

CSS Attribute

padding


paddingBottom

Description

Returns the CSS padding-bottom attribute, which specifies the height of the padding at the bottom of the element.

Syntax

object.paddingBottom[ = paddingBottom]

Remarks

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

style

CSS Attribute

padding-bottom


paddingLeft

Description

Returns the CSS padding-left attribute, which specifies the width of the padding at the left edge of the element.

Syntax

object.paddingLeft[ = paddingLeft]

Remarks

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

style

CSS Attribute

padding-left


paddingRight

Description

Returns the CSS padding-right attribute, which specifies the width of the padding at the right edge of the element.

Syntax

object.paddingRight[ = paddingRight]

Remarks

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

style

CSS Attribute

padding-right


paddingTop

Description

Sets the CSS padding-top attribute, which specifies the height of the padding at the top of the element.

Syntax

object.paddingTop[ = paddingTop]

Remarks

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

style

CSS Attribute

padding-top


pageBreakAfter

Description

Returns the CSS page-break-after attribute, which specifies whether a page break occurs after the element. Applies when printing the document.

Syntax

object.pageBreakAfter[ = pageBreakAfter]

Remarks

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

style

CSS Attribute

page-break-after


pageBreakBefore

Description

Returns the CSS page-break-before attribute, which specifies whether a page break occurs before the element. Applies when printing the document.

Syntax

object.pageBreakBefore[ = pageBreakBefore]

Remarks

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

style

CSS Attribute

page-break-before


palette

Description

Specifies the palette used for the embedded document.

Syntax

object.palette

Remarks

This property has read-only permission, meaning you can retrieve its current value, but not change it.

Applies To

EMBED


parent

Description

Returns the parent object in the object hierarchy.

Syntax

object.parent

Remarks

For a document, the parent is the containing window. For a window defined using FRAME, the parent is the window that contains the corresponding FRAMESET definition.

This property has read-only permission, meaning you can retrieve its current value, but not change it.

Applies To

window


parentElement

Description

Returns the parent element in the element hierarchy.

Syntax

object.parentElement

Remarks

The topmost element returns NULL as its parent.

This is a read-only property.

Applies To

A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IFRAME, IMG, INPUT, INS, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, META, NEXTID, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XMP


parentStyleSheet

Description

Returns the style sheet that was used for importing style sheets. If a style sheet is at the top level (that is, it's a LINK or STYLE), parentStyleSheet returns NULL.

Syntax

object.parentStyleSheet

Remarks

This property has read-only permission, meaning you can retrieve its current value, but not change it.

Applies To

styleSheet


parentTextEdit

Description

Returns the next element in the hierarchy that can be used to create a text range that contains the original element.

Syntax

object.parentTextEdit

Settings

This read-only property is an element object if the parent exists. Otherwise, it is null.

Example

The following example retrieves the parent element (if needed), creates the text range, moves to the original element, and selects the first word in the element.

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

Applies To

A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IFRAME, IMG, INPUT, INS, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, META, NEXTID, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XMP


parentWindow

Description

Returns the window object for the document.

Syntax

object.parentWindow

Remarks

This property has read-only permission, meaning you can retrieve its current value, but not change it.

Applies To

document


pathname

Description

Specifies the file or object path.

Syntax

object.pathname[ = pathname]

Remarks

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

A, AREA, location


pixelHeight

Description

Sets or retrieves the height of the element, in pixels. Unlike the height property, this property's value is an integer, not a string, and is always interpreted in pixels.

Syntax

object.pixelHeight[ = pixelHeight]

Settings

This read-write property can be any integer value. Setting this property changes the value of the height without changing the units designator.

Remarks

For more information on how to access the dimension and location of elements on the page through the document object model, see Measuring Element Dimension and Location.

Applies To

style

CSS Attribute

height

See Also

posHeight


pixelLeft

Description

Sets or retrieves the left position of the element, in pixels. Unlike the left property, this property's value is an integer, not a string, and is always interpreted in pixels.

Syntax

object.pixelLeft[ = pixelLeft]

Settings

This read-write property can be any integer value. Setting this property changes the value of the left position without changing the units designator.

Remarks

This property reflects the value of the CSS left attribute for positioned items. This property always returns zero for nonpositioned items since left does not mean anything unless the object is positioned. Use the offsetLeft property to calculate actual positions within the document area.

For more information on how to access the dimension and location of elements on the page through the document object model, see Measuring Element Dimension and Location.

Applies To

style

CSS Attribute

left

See Also

posLeft


pixelTop

Description

Sets or retrieves the top position of the element, in pixels. Unlike the top property, this property's value is an integer, not a string, and is always interpreted in pixels.

Syntax

object.pixelTop[ = pixelTop]

Settings

This read-write property can be any integer value. Setting this property changes the value of the top position without changing the units designator.

Remarks

This property reflects the value of the CSS top attribute for positioned items. This property always returns zero for nonpositioned items since top does not mean anything unless the object is positioned. Use the offsetTop property to calculate actual positions within the document area.

For more information on how to access the dimension and location of elements on the page through the document object model, see Measuring Element Dimension and Location.

Applies To

style

CSS Attribute

top

See Also

posTop


pixelWidth

Description

Sets or retrieves the width of the element, in pixels. Unlike the width property, this property's value is an integer, not a string, and is always interpreted in pixels.

Syntax

object.pixelWidth[ = pixelWidth]

Settings

This read-write property can be any integer value. Setting this property changes the value of the height without changing the units designator.

Remarks

For more information on how to access the dimension and location of elements on the page through the document object model, see Measuring Element Dimension and Location.

Applies To

style

CSS Attribute

width

See Also

posWidth


platform

Description

Indicates the platform that the browser is running on (for example, Win32®, Win16, WinCE, and so on).

Syntax

object.platform

Remarks

This property has read-only permission, meaning you can retrieve its current value, but not change it.

Applies To

navigator


plugins

Description

Returns an empty collection for Internet Explorer 4.0. This property exists for compatibility with other browsers.

Syntax

object.plugins

Remarks

This property has read-only permission.

Applies To

navigator


pluginspage

Description

Specifies the plug-ins supporting this embedded document.

Syntax

object.pluginspage

Remarks

This property has read-only permission, meaning you can retrieve its current value, but not change it.

Applies To

EMBED


port

Description

Specifies the port number in a URL.

Syntax

object.port[ = port]

Remarks

If no port is specified, an empty string is returned.

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

A, AREA, location


posHeight

Description

Sets and retrieves the height of the element in the units specified by the CSS height attribute. Unlike the height property, this property's value is a floating-point number, not a string.

Syntax

object.posHeight[ = posHeight]

Settings

This read-write property takes any valid floating-point number. Setting this property changes the value of the height but leaves the units designator for the property unchanged.

Remarks

For more information on how to access the dimension and location of elements on the page through the document object model, see Measuring Element Dimension and Location.

Example

The following JScript example increases the height of the first IMG element by 10 units.

document.all.tags("IMG").item(0).style.posHeight += 10;

Applies To

style

CSS Attribute

height

See Also

pixelHeight


position

Description

Specifies the CSS position attribute, which specifies the type of positioning used for the element.

Syntax

object.position

Remarks

This property has read-only permission, meaning you can retrieve its current value, but not change it.

Applies To

style

CSS Attribute

position


posLeft

Description

Sets and retrieves the left position of the element in the units specified by the CSS left attribute. Unlike the left property, this property's value is a floating-point number, not a string.

Syntax

object.posLeft[ = posLeft]

Settings

This read-write property takes any valid floating-point number. Setting this property changes the value of the left position but leaves the units designator for the property unchanged.

Remarks

This property reflects the value of the CSS left attribute for positioned items. This property always returns zero for nonpositioned items since left does not mean anything unless the object is positioned. Use the offsetLeft property to calculate actual positions within the document area.

For more information on how to access the dimension and location of elements on the page through the document object model, see Measuring Element Dimension and Location.

Example

The following JScript example moves the first IMG element to the left by 10 units.

document.all.tags("IMG").item(0).style.posLeft -= 10;

Applies To

style

CSS Attribute

left

See Also

pixelLeft


posTop

Description

Sets and retrieves the top position of the element in the units specified by the CSS top attribute. Unlike the top property, this property's value is a floating-point number, not a string.

Syntax

object.posTop[ = posTop]

Settings

This read-write property takes any valid floating-point number. Setting this property changes the value of the top position but leaves the units designator for the property unchanged.

Remarks

This property reflects the value of the CSS top attribute for positioned items. This property always returns zero for nonpositioned items since top does not mean anything unless the object is positioned. Use the offsetTop property to calculate actual positions within the document area.

For more information on how to access the dimension and location of elements on the page through the document object model, see Measuring Element Dimension and Location.

Example

The following JScript example moves the first IMG element up by 10 units.

document.all.tags("IMG").item(0).style.posTop -= 10;

Applies To

style

CSS Attribute

top

See Also

pixelTop


posWidth

Description

Sets and retrieves the width of the element in the units specified by the CSS width attribute. Unlike the width property, this property's value is a floating-point number, not a string.

Syntax

object.posWidth[ = posWidth]

Settings

This read-write property takes any valid floating-point number. Setting this property changes the value of the width but leaves the units designator for the property unchanged.

Remarks

For more information on how to access the dimension and location of elements on the page through the document object model, see Measuring Element Dimension and Location.

Example

The following JScript example increases the width of the first IMG element by 10 units.

document.all.tags("IMG").item(0).style.posWidth -= 10;

Applies To

style

CSS Attribute

width

See Also

pixelWidth


protocol

Description

Specifies the initial substring up to and including the first colon, which indicates the URL's access method.

Syntax

object.protocol[ = protocol]

Remarks

This property has read-write permissions, meaning you can change as well as retrieve its current value.

Applies To

A, AREA, IMG, location

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.