HTML DOM Style cursor Property

# Style cursor Property

Style Object

## Example

Change the cursor:

document.getElementById("myP").style.cursor = "pointer";
Try it yourself »

## Definition and Usage

The cursor property sets or returns the type of cursor to display for the mouse pointer.

## Browser Support

The cursor property is supported in all major browsers.

## Syntax

Return the cursor property:

object.style.cursor

Set the cursor property:

object.style.cursor=value

## Property Values

Value | Description
--- | ---
alias | The cursor indicates an alias of something is to be created
all-scroll | The cursor indicates that something can be scrolled in any direction
auto | Default. The browser sets a cursor
cell | The cursor indicates that a cell (or set of cells) may be selected
context-menu | The cursor indicates that a context-menu is available
col-resize | The cursor indicates that the column can be resized horizontally
copy | The cursor indicates something is to be copied
crosshair | The cursor render as a crosshair
default | The default cursor
e-resize | The cursor indicates that an edge of a box is to be moved right (east)
ew-resize | Indicates a bidirectional resize cursor
help | The cursor indicates that help is available
move | The cursor indicates something is to be moved
n-resize | The cursor indicates that an edge of a box is to be moved up (north)
ne-resize | The cursor indicates that an edge of a box is to be moved up and right (north/east)
nesw-resize | Indicates a bidirectional resize cursor
ns-resize | Indicates a bidirectional resize cursor
nw-resize | The cursor indicates that an edge of a box is to be moved up and left (north/west)
nwse-resize | Indicates a bidirectional resize cursor
no-drop | The cursor indicates that the dragged item cannot be dropped here
none | No cursor is rendered for the element
not-allowed | The cursor indicates that the requested action will not be executed
pointer | The cursor is a pointer and indicates a link
progress | The cursor indicates that the program is busy (in progress)
row-resize | The cursor indicates that the row can be resized vertically
s-resize | The cursor indicates that an edge of a box is to be moved down (south)
se-resize | The cursor indicates that an edge of a box is to be moved down and right (south/east)
sw-resize | The cursor indicates that an edge of a box is to be moved down and left (south/west)
text | The cursor indicates text that may be selected
URL | A comma separated list of URLs to custom cursors. Note: Always specify a generic cursor at the end of the list, in case none of the URL-defined cursors can be used
vertical-text | The cursor indicates vertical-text that may be selected
w-resize | The cursor indicates that an edge of a box is to be moved left (west)
wait | The cursor indicates that the program is busy
zoom-in | The cursor indicates that something can be zoomed in
zoom-out | The cursor indicates that something can be zoomed out
initial | Sets this property to its default value. Read about initial
inherit | Inherits this property from its parent element. Read about inherit

## Technical Details

Default Value: | auto
Return Value: | A String, representing the displayed mouse cursor when the mouse pointer is over an element
CSS Version | CSS2

## More Examples

## Example

Show all available cursors:

var whichSelected = x.selectedIndex;
document.body.style.cursor = x.options[whichSelected].text;
Try it yourself »

## Example

Return the type of cursor:

alert(document.getElementById("myP").style.cursor);
Try it yourself »

## Related Pages

CSS reference: cursor property

Style Object

### WEB HOSTING

UK Reseller Hosting

### WEB BUILDING

FREE Website BUILDER Free HTML5 Templates

### W3SCHOOLS EXAMS

HTML, CSS, JavaScript, PHP, jQuery, XML, and ASP Certifications

### SHARE THIS PAGE

### Color Picker

### HTML/CSS

HTML Tutorial HTML5 Tutorial CSS Tutorial CSS3 Tutorial Bootstrap Tutorial

### JavaScript

JavaScript Tutorial jQuery Tutorial jQuery Mobile Tutorial AngularJS Tutorial AJAX Tutorial JSON Tutorial

### Graphics

Canvas Tutorial SVG Tutorial Google Maps Tutorial

### Server Side

SQL Tutorial PHP Tutorial ASP Tutorial ASP.NET Tutorial VBScript Tutorial AppML Tutorial

### Web

Web Building Web Statistics Web Certification

### XML

XML Tutorial DTD Tutorial Schema Tutorial XML DOM Tutorial XPath Tutorial XSLT Tutorial XQuery Tutorial XSL-FO Tutorial RSS Tutorial WSDL Tutorial

### HTML/CSS

HTML Tag Reference HTML Event Reference HTML Color Reference CSS 1,2,3 Reference Bootstrap Reference

### JavaScript

JavaScript Reference HTML DOM Reference jQuery Reference jQuery Mobile Reference Google Maps Reference

### Server Side

PHP Reference SQL Reference ASP Reference VBScript Reference Razor Reference ASP.NET Reference

### XML

XML DOM Reference XSLT Reference XSL-FO Reference XPath Reference XQuery Reference Schema Reference RSS Reference SVG Reference

### HTML Charsets

HTML Character Sets HTML ASCII HTML ANSI HTML Windows-1252 HTML ISO-8859-1 HTML Symbols HTML UTF-8

### HTML/CSS

HTML Examples CSS Examples

### Browser Scripting

JavaScript Examples HTML DOM Examples jQuery Examples jQuery Mobile Examples AngularJS Examples AJAX Examples

### Server Scripting

PHP Examples ASP Examples VBScript Examples Razor Examples .NET Examples

### XML Languages

XML Examples DTD Examples XML DOM Examples XSL Examples XSLT Examples XPath Examples XQuery Examples Schema Examples RSS Examples SVG Examples