napisałem odpowiednie funkcyjki JS - może komuś się przyda. Zamiast div'a można dać np. mapkę i wskazać gdzie znajduje się dany obiekt na mapie (współrzędne zrzucone do inputów).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> #area { background-color: #CCC; height: 200px; width: 300px; } #point { background-color: #000; height: 3px; position: relative; width: 3px; } </style> <script type="text/javascript"> function getXY(e) { var posx = 0; var posy = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } posx = posx - parseInt(document.getElementById('area').offsetLeft); posy = posy - parseInt(document.getElementById('area').offsetTop); document.getElementById('x').value = posx; document.getElementById('y').value = posy; movePoint(posx, posy); } function movePoint(posx, posy) { document.getElementById('point').style.left = posx + 'px'; document.getElementById('point').style.top = posy + 'px'; } </script> </head> <body> <div id="area" onclick="getXY(event);"> </div> <input id="x" /> <input id="y" /> </body> </html>