DataTransferItemList

翻译不完整。 请帮助我们翻译这篇文章!

DataTransferItemList 对象是一组代表被拖动项的DataTransferItem 对象的列表。在拖动操作期间,每个DragEvent 都有一个 dataTransfer 属性,该属性是 DataTransferItemList.

该接口没有构造函数

属性

DataTransferItemList.length 只读
 无符号长整型 :列表中拖动项的数量。

方法

DataTransferItemList.add()
向拖动项列表中添加新项 (File对象或string),该方法返回一个 DataTransferItem 对象。
DataTransferItemList.remove()
根据索引删除拖动项列表中的对象。
DataTransferItemList.clear()
清空拖动项列表。
DataTransferItemList.DataTransferItem()
取值方法:返回给定下标的DataTransferItem对象.

示例

每个方法或属性都有其引用页面,每一个引用页对应也有使用示例。

规范

规范 状态 备注
HTML Living Standard
DataTransferItemList
Living Standard
HTML 5.1
DataTransferItemList
Recommendation Not included in W3C HTML5 Recommendation

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
DataTransferItemListChrome Full support 13Edge Full support ≤18Firefox Full support 50IE No support NoOpera Full support 12Safari Full support 6WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 6Samsung Internet Android Full support 1.0
DataTransferItemList[]Chrome Full support 13Edge Full support ≤79Firefox Full support 50IE No support NoOpera Full support 12Safari Full support 6WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 6Samsung Internet Android Full support 1.0
addChrome Full support 13Edge No support 12 — 79Firefox Full support 50IE No support NoOpera Full support 12Safari Full support 6WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 6Samsung Internet Android Full support 1.0
clearChrome Full support 13Edge Full support 12Firefox Full support 50IE No support NoOpera Full support 12Safari Full support 6WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 6Samsung Internet Android Full support 1.0
lengthChrome Full support 13Edge Full support 12Firefox Full support 50IE No support NoOpera Full support 12Safari Full support 6WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 6Samsung Internet Android Full support 1.0
removeChrome Full support 31Edge Full support 12Firefox Full support 50IE No support NoOpera Full support 12Safari Full support 6WebView Android Full support 4.4.3Chrome Android Full support 31Firefox Android Full support 50Opera Android No support NoSafari iOS Full support 6Samsung Internet Android Full support 2.0

Legend

Full support  
Full support
No support  
No support