W3Schools.com

Style cursor Property

Style Object Reference Style Object

Definition and Usage

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

Syntax

Set the cursor property:

Object.style.cursor="value"

Return the cursor property:

Object.style.cursor

Value Description
auto Browser default cursor (often an arrow). This is default
crosshair Crosshair cursor
default Platform-depended default cursor (often an arrow)
e-resize East arrows. Indicates that an element is resizable
help Arrow with question mark, indicating that help is available
move Crossed arrows, indicating that something can be moved
n-resize North arrows. Indicates that an element is resizable
ne-resize North-east arrows. Indicates that an element is resizable
nw-resize North-west. Indicates that an element is resizable
pointer Normal hand
s-resize South arrows. Indicates that an element is resizable
se-resize South-east arrows. Indicates that an element is resizable
sw-resize South-west arrows. Indicates that an element is resizable
text The cursor indicates text
url The URL of a cursor file to be used. Tip: Always define a generic cursor at the end of the list in case none of the url-defined cursors work
w-resize West arrows. Indicates that an element is resizable
wait Hourglass or watch, indicating that the program is busy
 

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The cursor property is supported in all major browsers.


Example

Example

Change the cursor:

<html>
<head>
<script type="text/javascript">
function displayResult()
{
document.getElementById("p1").style.cursor="pointer";
}
</script>
</head>
<body>

<p id="p1">Mouse over this text!</p>
<br />

<button type="button" onclick="displayResult()">Change cursor</button>

</body>
</html>

Try it yourself »


Examples

More Examples

More cursors
Show all available cursors.


Style Object Reference Style Object

W3Schools Certification

W3Schools' Online Certification

The perfect solution for professionals who need to balance work, family, and career building.

More than 10 000 certificates already issued!

Get Your Certificate »

The HTML Certificate documents your knowledge of HTML.

The CSS Certificate documents your knowledge of advanced CSS.

The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.

The jQuery Certificate documents your knowledge of jQuery.

The XML Certificate documents your knowledge of XML, XML DOM and XSLT.

The ASP Certificate documents your knowledge of ASP, SQL, and ADO.

The PHP Certificate documents your knowledge of PHP and SQL (MySQL).

WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE