html5 拖拽事件,js实现拖拽删除功能。请大神赐教!

mac2022-06-30  21

想把图片拉到删除框内,图片就会被删除,我在用了removeChild() 方法,但是不行,不知道用使用错误还是该方法解决不了这个问题,请大神帮忙看看。附上实现拉图片到删除框的JS代码。

function enter(e){ //var three=document.getElementById('three'); var b=e.dataTransfer.getData('aa');//图片id document.getElementById(b).removeChild(b); }
最新回复(0)