Take the 2-minute tour ×

I'm experimenting with HTML5's Drag and Drop. I'm trying to drag an html button. On my listener of the drag and drop events, however, I can't seem to be able to access most actual event parameters. On drop event I can't seem to find the clientX parameter. When I tried to set the data of the transferData (in the listener of startdrag), it also said transferData was undefined.

I'm using jQuery for binding the events (but using native DnD) and the listener functions, like so:

function handledrop(event) {
  var mouseX = event.clientX;

Another question: the drag and drop is only working in Chrome - in Firefox it doesn't even begin to drag. What are the differences of implementation across browsers?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Added the event listener $([name=droppable])[0].addEventListener('drop',handleDrop);. The event received in handleDrop now matches expectations.

share|improve this answer
add comment

Your Answer


