0

Is their a function to get cords on a webpage

exactly what the title says but to explain if i were to say onclick i want such fuction to go and give me cords the move such sprite to said point how would i hanndle that

6th Apr 2017, 3:31 AM
Rwby Panda
Rwby Panda - avatar
1 Odpowiedź
+ 6
<!DOCTYPE html> <html> <head> <title>Page Title</title> <style> #myDiv{ border:1px solid black; background-color:powderblue; height:320px; } </style> </head> <body> <div id="myDiv"></div> <script> document.getElementById("myDiv").onclick=function(evt){ alert(evt.clientX+","+evt.clientY); } </script> </body> </html> something like this?
8th Apr 2017, 5:52 AM
Burey
Burey - avatar