
Represents the active selection, a highlighted block of text and/or other elements in the document upon which a user or a script can carry out some action. You typically use the selection object as input from the user identifying what portion of the document to act on, or as output to the user showing the results of an action.
Users and scripts can both create selections. Users create selections by dragging the mouse over a portion of the document. Scripts create them by calling the select method on a text range or similar object. You can retrieve the active selection by applying the selection keyword to the document object. To carry out work on a selection, you can create a text range object from the selection by using the createRange method.
A document can have only one selection at a time. The selection has a type that determines whether it is empty or contains a contiguous block of consecutive text and/or elements. Although an empty selection contains nothing, it is useful for marking a position in the document.
Specifies that the enclosed text should be displayed with a relatively smaller font than the current font.
className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title
click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute
onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselectstart
Specifies an inline text container. This element is especially useful for applying CSS styles.
className, dataFld, dataFormatAs, dataSrc, document, id, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerText, parentElement, parentTextEdit, scrollHeight, scrollLeft, scrollTop, scrollWidth, sourceIndex, style, tagName, title
blur, click, contains, focus, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute
onblur, onclick, ondblclick, ondragstart, onfilterchange, onfocus, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onscroll, onselectstart
Renders text in strike-through type.
className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title
click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute
onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselectstart
Renders text in bold.
className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title
click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute
onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselectstart
Specifies a style sheet for the page.
This element can appear in either HEAD or BODY, but HEAD is the preferred location. Multiple style blocks are permitted.
className, disabled, document, id, isTextEdit, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, parentElement, parentTextEdit, readyState, sourceIndex, style, tagName, type
click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, scrollIntoView, setAttribute
Represents the current settings of all possible inline styles for a given element.
Inline styles are CSS style assignments that an author applies directly to individual HTML elements using the STYLE= attribute. You use the style object to examine these assignments and either make new assignments or change existing ones.
You can retrieve the style object by applying the style keyword to an element object. You retrieve the current setting for an inline style by applying the corresponding style property to the style object.
The style object does not give access to the style assignments in style sheets. To obtain information about styles in style sheets, you must use the styleSheets collection to gain access to the individual style sheets defined in the document.
The following example sets the typeface for text in the document body to "Verdana".
document.body.style.fontFamily = "Verdana"The following example positions the given image at the top of the document.
var i = document.all.tags("IMG"); if (i.length>0) { if (i[0].style.position == "absolute") i[0].style.top = 0; }
background, backgroundAttachment, backgroundColor, backgroundImage, backgroundPosition, backgroundPositionX, backgroundPositionY, backgroundRepeat, border, borderBottom, borderBottomColor, borderBottomStyle, borderBottomWidth, borderColor, borderLeft, borderLeftColor, borderLeftStyle, borderLeftWidth, borderRight, borderRightColor, borderRightStyle, borderRightWidth, borderStyle, borderTop, borderTopColor, borderTopStyle, borderTopWidth, borderWidth, clear, clip, color, cssText, cursor, display, filter, font, fontFamily, fontSize, fontStyle, fontVariant, fontWeight, height, left, letterSpacing, lineHeight, listStyle, listStyleImage, listStylePosition, listStyleType, margin, marginBottom, marginLeft, marginRight, marginTop, overflow, paddingBottom, paddingLeft, paddingRight, paddingTop, pageBreakAfter, pageBreakBefore, pixelHeight, pixelLeft, pixelTop, pixelWidth, posHeight, position, posLeft, posTop, posWidth, styleFloat, textAlign, textDecoration, textDecorationBlink, textDecorationLineThrough, textDecorationNone, textDecorationOverline, textDecorationUnderline, textIndent, textTransform, top, verticalAlign, visibility, width, zIndex
Represents a single style sheet in the document.
You use the object to retrieve information about the style sheet, such as the URL of the source file for the style sheet and the element in the document that owns (defines) the style sheet, and also to modify the style sheet.
You retrieve a style sheet object from the styleSheets collection or from the imports collection. Each item in these collections is a style sheet. A style sheet object is available for a style sheet only if it is included in a document with a STYLE or LINK element, or with an @import statement in a STYLE element.
disabled, href, id, owningElement, parentStyleSheet, readOnly, type
Specifies that the enclosed text should be displayed in subscript, using a smaller font than the current font.
className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title
click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute
onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselectstart
Specifies that the enclosed text should be displayed in superscript and in a smaller font relative to the current font.
className, document, id, innerHTML, innerText, isTextEdit, lang, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title
click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute
onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselectstart
Specifies that the contained content is organized into a table with rows and columns.
Valid tags within a table include:
This element is a block element. When a document is loading, modifications to a table is restricted until the window.onload event occurs. Read-only access is allowed at anytime.
align, background, bgColor, border, borderColor, borderColorDark, borderColorLight, cellPadding, cellSpacing, className, clientHeight, clientWidth, cols, dataFld, dataPageSize, dataSrc, document, frame, height, id, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerText, parentElement, parentTextEdit, rules, scrollHeight, scrollLeft, scrollTop, scrollWidth, sourceIndex, style, tagName, title, width
blur, click, contains, focus, getAttribute, insertAdjacentHTML, insertAdjacentText, nextPage, previousPage, refresh, removeAttribute, scrollIntoView, setAttribute
onafterupdate, onbeforeupdate, onblur, onclick, ondblclick, ondragstart, onfocus, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onresize, onrowenter, onrowexit, onscroll, onselectstart
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.