如题,以下的代码并没有触发ondragexit,请教h5高手
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title></title>
<style type="text/css">
div {
width: 100px;
height: 100px;
background: red;
}
p {
border: 1px solid black;
width: 150px;
height: 150px;
}
</style>
</head>
<body>
<div draggable="true" id="div">
div
</div>
<p id="target"></p>
<script type="text/javascript">
var dragged;
var oDiv = document.getElementById('div')
var oTarget = document.getElementById('target')
oDiv.ondragstart = function(e){
e.dataTransfer.setData('text/plain', 'baidu')
dragged = e.target
console.log(dragged, 'dragged')
}
oTarget.ondragover = function (e) {
e.preventDefault()
}
oTarget.ondrop = function () {
oTarget.appendChild(oDiv)
}
oDiv.ondragend = function() {
console.log('dragend')
}
oDiv.ondragexit = function () {
console.log('ondragexit')
}
oDiv.ondragleave = function () {
console.log('ondragleave')
}
</script>
</body>
</html>