This example uses the addEventListener() method to attach "dragstart", "drag", "dragover" and "drop" events to the document object.

Drag the p element back and forth between the two rectangles:

move:

Drag me too (2)!

Drag me(1)!

Note: drag events are not supported in Internet Explorer 8 and earlier versions or Safari 5.1 and earlier versions.