I am trying to implement something like this, a predefined symbol or text should be putted on a image where clicked. Suppose there is an image and I had clicked on the top right corner of that image. Now I want to show something on that clicked position. I can get the coordinate of the clicked position. But I am not getting how I can put something on that place using this coordinate. This is what I had tried.
HTML code :
<img src="result.png" alt="" id="image">
JS code:
$('#image').click(function (e) {
var posX = $(this).position().left,
posY = $(this).position().top,
positionX = e.pageX - posX,
positionY = e.pageY - posY;
$("#image").html('<p id="clicked">Clicked here</p>');
});