一、文件API
File API:提供客户端本地操作文件的可能
multiple是让文件域可以多选
1 2 3 4 518 55 56文件API 6 7 8 9
二、拖放操作
在捕获drop事件时,必须先阻止默认事件。
//如果要捕获drop事件,就一定要在该事件中阻止默认事件 target.addEventListener('dragover',function(e){ e.preventDefault();//阻止默认事件 e.stopPropagation();//阻止冒泡 });
1 2 3 4 5 6拖放操作 7 8 9 28 29 30 313243 97 98 993334Drag&Drop
3538你好啊,你今年几岁啊,哈哈,我的今天在哪里
36 3739
40 Drag something into here4142