I
I
Ignatiy22019-05-01 11:36:51
JavaScript
Ignatiy2, 2019-05-01 11:36:51

How to change cursor on hover in JavaScript?

Let's say I created an image using new Image() and I need the cursor to change to pointer when hovering over this image. I tried to do like this:

var car = new Image();
car.src = "img/Машина.png";

car.style.cursor = "pointer";

But there is no effect

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniel, 2019-05-01
@Ignatiy2

Well, I don't know, everything works for me

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question