0

[SOLVED] How to make a div's position equal to cursor's one

I have made a html code with a cursor img and I want to make its position change on each mouse move, but it doesn't move :( how to fix it?, my code: https://code.sololearn.com/W9Qwr385C46g/?ref=app

12th Dec 2020, 5:13 PM
Sousou
Sousou - avatar
3 Answers
+ 3
Because you have to concat value of clientX and clientY with "px". For example: let leftValue = e.clientX + "px";
13th Dec 2020, 3:10 AM
Raj Chhatrala
Raj Chhatrala - avatar
+ 1
Raj Chhatrala thanks it works now
13th Dec 2020, 10:30 AM
Sousou
Sousou - avatar
+ 1
I'm glad to help Sousou :)
13th Dec 2020, 11:03 AM
Raj Chhatrala
Raj Chhatrala - avatar