November 29, 1999 - Changing the Cursor | WebReference

November 29, 1999 - Changing the Cursor

Yehuda Shiran November 29, 1999
Changing the Cursor
Tips: November 1999

Yehuda Shiran, Ph.D.
Doc JavaScript

Internet Explorer supports the cursor CSS property. It accepts one of the following values:

Cursors

PropertyDescription
autoBrowser determines which cursor to display based on the current context
crosshairSimple cross hair
defaultPlatform-dependent default cursor (usually an arrow)
handHand
moveCrossed arrows indicating something is to be moved
dir-resizeArrow indicating edge is to be moved (dir may be n, ne, nw, s, se, sw, e, or w)
textEditable text (usually an I-bar)
waitHourglass or watch indicating that the program is busy and the user should wait
helpArrow with question mark indicating help is available

If you're using Internet Explorer, pass the mouse over this paragraph. The style of the cursor changes to crosshair:

<FONT ... STYLE="cursor: crosshair">any text here</FONT>

The cursor property can be applied to almost any HTML element, including the <BODY> tag. The cursor property can also be set in JavaScript:

object.style.cursor = shape;

For example, the following statement changes the cursor anywhere on the page:

document.body.style.cursor = "wait";