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 4Edge Full support YesFirefox Full support 50IE No support NoOpera Full support 12Safari Full support 11.1WebView Android No support NoChrome Android No support NoFirefox Android Full support 50Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
DataTransferItemList[]Chrome Full support 4Edge ? Firefox Full support 50IE No support NoOpera Full support 12Safari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 50Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
addChrome No support NoEdge Full support 12Firefox Full support 50IE No support NoOpera Full support 12Safari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 50Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
clearChrome Full support 4Edge Full support 12Firefox Full support 50IE No support NoOpera Full support 12Safari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 50Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
lengthChrome Full support 4Edge Full support 12Firefox Full support 50IE No support NoOpera Full support 12Safari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 50Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?
removeChrome Full support 4Edge Full support 12Firefox Full support 50IE No support NoOpera Full support 12Safari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 50Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown