The cursor can set to wait in JavaScript by using the property ‘cursor’ property. The following example illustrates the usage.
window.document.body.style.cursor = "wait"; // sets the cursor shape to hour-glass.