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
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?