DEL
Objects Reference

DEL

Description

Indicates text that has been deleted from the document.

Properties

className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title

Methods

click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute

Collections

all, children, filters

Events

onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup

HTML Element

DEL

See Also

INS


DFN

Description

Indicates the defining instance of a term.

Remarks

This element is a block element.

Properties

className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title

Methods

click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute

Collections

all, children, filters

Events

onclick, ondblclick, ondragstart, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselectstart

HTML Element

DFN

See Also

ACRONYM, ADDRESS, CITE, I


DIR

Description

Denotes a directory list.

Remarks

This element is a block element.

Properties

className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title

Methods

click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute

Collections

all, children, filters

Events

onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselectstart

HTML Element

DIR


DIV

Description

Specifies a container that renders HTML.

Remarks

This element is a block element.

Properties

align, className, clientHeight, clientWidth, 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

Methods

blur, click, contains, focus, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute

Collections

all, children, filters

Events

onafterupdate, onbeforeupdate, onblur, onclick, ondblclick, ondragstart, onfocus, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onresize, onrowenter, onrowexit, onscroll, onselectstart

HTML Element

DIV


DL

Description

Denotes a definition list.

Remarks

This element is a block element.

Properties

className, compact, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title

Methods

click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute

Collections

all, children, filters

Events

onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselectstart

HTML Element

DL

See Also

DD, DT


document

Description

Represents the HTML document in a given browser window. You use the document object to retrieve information about the document, to examine and modify the HTML elements and text within the document, and to process events.

The document object is available at all times. You can retrieve the object by applying the document property to a window or element object. If used by itself, document represents the document in the current window.

Examples

The following example checks for a document title and displays the title (if not null) in an alert (message) box.

if (document.title!="") 
    alert("The title is " + document.title)

The following example checks whether the current document contains any IFRAME elements, and, if it does, displays the name of the source file associated with each element.

for (i=0; i<document.all.tags("IFRAME").length; i++)
        alert("Source file "+i+" is named "+ document.all.tags("IFRAME").item(i).src);

The following example shows an event handler function that displays the current position of the mouse (relative to the upper-left corner of the document) in the browser's status window.

<HTML>
<HEAD><TITLE>Report mouse moves</TITLE>
<SCRIPT LANGUAGE="JScript">
function reportMove() {
    window.status = "X=" + window.event.x + " Y=" + window.event.y;
}
</SCRIPT>
<BODY onmousemove="reportMove()">
<H1>Welcome!</H1>
</BODY>
</HTML>

Properties

activeElement, alinkColor, bgColor, body,charset, cookie, defaultCharset, domain, expando, fgColor, lastModified, linkColor, location, parentWindow, readyState, referrer, selection, title, URL, vlinkColor

Collections

all, anchors, applets, children, embeds, forms, frames, images, links, plugins, scripts, styleSheets

Methods

clear, close, createElement, createStyleSheet, elementFromPoint, execCommand, open, queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandSupported, queryCommandText, queryCommandValue, ShowHelp, write, writeln

Events

onafterupdate, onbeforeupdate, onclick, ondblclick, ondragstart, onerrorupdate, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onreadystatechange, onrowenter, onrowexit, onselectstart


DT

Description

Indicates a definition term within a definition list.

Remarks

This element is a block element.

Properties

className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title

Methods

click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute

Collections

all, children, filters

Events

onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup onselectstart

HTML Element

DT

See Also

DD, DL


EM

Description

Emphasizes text, usually by rendering it in italic.

Properties

className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName, title

Methods

click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute

Collections

all, children, filters

Events

onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup onselectstart

HTML Element

EM

See Also

ACRONYM, ADDRESS, CITE, I


EMBED

Description

Allows you to embed documents of any type. The user needs to have an application that can view the data installed correctly on his or her computer. The EMBED object must appear inside the BODY of the document.

Remarks

This element is a block element.

Properties

accessKey, align, className, document, height, Hidden, id, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, palette, parentElement, parentTextEdit, pluginspage, sourceIndex, src, style, tagName, title, units, width

Methods

blur, contains, focus, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute

Collections

all, children, filters

Events

onblur, onfocus

HTML Element

EMBED


event

Description

Represents the state of an event, such as the element in which the event occurred, the state of the keyboard keys, the location of the mouse, and the state of the mouse buttons.

The event object is available only during an event. That is, you can use it in event handlers but not in other code. You retrieve the event object by applying the event keyword to the window object.

Although all event properties are available to all event objects, some properties might not have meaningful values during some events. For example, the fromElement and toElement properties are meaningful only when processing the onmouseover and onmouseout events.

Examples

The following example checks whether a mouse click occurred within a link and prevents the link from being carried out if the SHIFT key is down.

<HTML>
<HEAD><TITLE>Cancels Links</TITLE>
<SCRIPT LANGUAGE="JScript">
function cancelLink() {
    if (window.event.srcElement.tagName == "A" && window.event.shiftKey) 
        window.event.returnValue = false;
}
</SCRIPT>
<BODY onclick="cancelLink()">

The following example displays the current mouse position in the browser's status window.

<BODY onmousemove="window.status = 'X=' + window.event.x + ' Y=' + window.event.y">

Note that in VBScript you cannot use the event keyword without applying it to the window keyword or an expression that evaluates to a window.

Properties

altKey, button, cancelBubble, clientX, clientY, ctrlKey, fromElement, keyCode, offsetX, offsetY, reason, returnValue, screenX, screenY, shiftKey, srcElement, srcFilter, toElement, type, x, y

Applies To

window

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