Reputation: 31
I want to add an image exactly where a user clicks. I have this so far, but it just adds the image to the top and just keeps adding it there...not where the user is clicking
<html>
<head>
<script type="text/javascript">
function stamp(d,e)
{
var i = new Image();
i.src = 'smiley.jpg';
document.getElementById('target').appendChild(i);
//document.getElementById('target').style.left = "100px"; //e.clientX ;
//document.getElementById('target').style.right = "1000px"; //e.clientY;
}
</script>
</head>
<body id="target" onclick="javascript:stamp(this,event);" style="left: 100px">
</body>
</html>
Upvotes: 3
Views: 84