My problem is this: I have generated a point I made in CSS in an image that I call in my JS, however, it must be generated in the coordinates that are captured when clicking on the image.
<script type="text/javascript">
function coordenadas(event){
x = event.clientX;
y = event.clientY;
//alert("X: "+x+" Y: "+y);
}
</script>
<script type="text/javascript">
function image() {
var x = Math.floor(Math.random() * (17 - 1) + 1);
var img = new Image();
img.src = "../radiografias/"+x+".jpg";
document.getElementById('image').innerHTML = "<img style=\"cursor:crosshair\" href=\"#\" onmousedown= \"coordenadas(event)\" src=\""
+ img.src + "\" width=1100 />";
}
</script>
<style>
.ponto{
width: 5px;
height: 5px;
border-radius: 50%;
background-color: #FFFF00;
position: absolute;
}
</style>
<div id="image"></div>
If someone can help, thank you very much ...