In Chrome, a drag and drop event fires and logs to the console. In Firefox and IE, this is not the case.
<html>
<head>
<style>
#d {
width:20px;
height:20px;
background-color: red;
}
</style>
</head>
<body>
<div id="d" draggable="true"></div>
<script>
d = document.getElementById('d');
d.addEventListener('dragstart', function(e){
console.log("dragstart:", e);
});
d.addEventListener('drag', function(e){
console.log("drag:", e);
});
</script>
</body>
</html>
Script Version: http://jsfiddle.net/korimako/e1wqafyr
How to set up a div to send drag events and listen to them correctly?
source
share