windowelement or other top-level elements. In order to revert to the normal cursor state call the method
removeAttribute("wait-cursor")when the process effectively has ended otherwise the wait cursor might never disappear.
This seems to work instead of trying to set a wait-cursor attribute:
window.setCursor('wait') and window.setCursor('auto')