click to create / place images with js

53 Views Asked by At

searching for a js-solution to click and to create/place an image at this point. If I move the mouse to a different point, another click should place a second image, and so on.

1

There are 1 best solutions below

1
Brainmaniac On

One way is something like this:

  1. First get the position from the click: javascript get x and y coordinates on mouse click

  2. Add an eventlistner to click that places an absolute positioned image with the coordinates gained above. https://www.w3schools.com/js/js_htmldom_eventlistener.asp