System Drag And Drop Example

by Paul Leech

HTML

<body ondragover="getPos(event)">
  <p>Select me, then drag me.</p>
</body>

JavaScript

function getPos(event) {
  if(console)
    console.log('Y:', event.clientY, '\nX:', event.clientX);
}