Web/API/Window/setCursor

From Get docs

Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.


The Window.setCursor() method sets the cursor for the current window.

Example

function setBusyCursor(enable) {
  window.setCursor(enable ? "wait" : "auto");
}

Notes

The cursor isn't reset until it's set back to auto.

This function is a part of [[../../../../Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMChromeWindow|ChromeWindow interface]]. This function is unavailable to web pages, which can use the CSS cursor property instead.

Specification

This is not part of any specification.

Browser Compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

setCursor

Non-standard'

Chrome

No support No

Edge

No support No

Firefox

No support No

IE

?

Opera

?

Safari

?

WebView Android

No support No

Chrome Android

No support No

Firefox Android

No support No

Opera Android

?

Safari iOS

?

Samsung Internet Android

No support No

Legend

No support  
No support
Compatibility unknown  
Compatibility unknown
Non-standard. Expect poor cross-browser support.'
Non-standard. Expect poor cross-browser support.