Reputation: 190
I am trying to change my cursor icon in a paint appliation using Javascript. The jpeg icon which I want to use for that purpose is saved locally. Can I use the following line to make this work?
document.body.style.cursor = "server/icon.jpg";
How could I make it work using a url alternatively?
Upvotes: 0
Views: 228
Reputation: 4782
Use the url
property instead:
document.body.style.cursor = "url('server/icon.jpg'), auto"
You may want to check MDN for documentation related with cursor css.
Upvotes: 2