How to change the cursor when you hover in JavaScript?

For example, I created the image using new Image() and I need when you hover over the image the cursor changed to pointer. I tried to do so:
var car = new Image();
car.src = "img/Car.png";

car.style.cursor = "pointer";

But no effect.
March 20th 20 at 11:20
2 answers
March 20th 20 at 11:22
Solution
I don't know, I have everything working
Forgot to specify that these images I draw in canvas - Tracy_Cummings commented on March 20th 20 at 11:25
@ciara_Fadel, Then you can only catch the coordinates of the cursor when moving on canvas'and if the cursor is within the image, change the cursor in the styles of the canvas element. - Kathleen63 commented on March 20th 20 at 11:28
@ciara_Fadel, this important information should write in the question.

From a DOM perspective, you have no more pictures, only canvas, so only to determine the coordinates and change the cursor - alden73 commented on March 20th 20 at 11:31
March 20th 20 at 11:24
Solution
Hang on canvas. addEventListener("mousemove ", e => {});where e is the event object the mouse, there are coordinates on which the cursor moves, check whether it is in the area occupied by the image on the canvas or not.

Find more questions by tags JavaScriptCanvas