DataTransferItemList

DataTransferItemList object is a list of DataTransferItem objects representing items being dragged. During a drag operation , each DragEvent has a dataTransfer property and that property is a DataTransferItemList .

This interface has no constructor.

特性

DataTransferItemList.length 只读
An unsigned long that is the number of drag items in the list.

方法

DataTransferItemList.add()
Adds an item (either a File object or a string ) to the drag item list and returns a DataTransferItem object for the new item.
DataTransferItemList.remove()
Removes the drag item from the list at the given index.
DataTransferItemList.clear()
Removes all of the drag items from the list.
DataTransferItemList.DataTransferItem()
Getter that returns a DataTransferItem at the given index.

范例

Each of this interface's methods and properties has a reference page, and each reference page has an example of its usage.

规范

规范 状态 Comment
HTML Living Standard
The definition of 'DataTransferItemList' in that specification.
实时标准
HTML 5.1
The definition of 'DataTransferItemList' in that specification.
Recommendation Not included in W3C HTML5 Recommendation

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
DataTransferItemList Chrome 13 Edge ≤18 Firefox 50 IE No Opera 12 Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 50 Opera Android No Safari iOS 6 Samsung Internet Android 1.0
DataTransferItemList[] Chrome 13 Edge ≤79 Firefox 50 IE No Opera 12 Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 50 Opera Android No Safari iOS 6 Samsung Internet Android 1.0
add Chrome 13 Edge 12 — 79 Firefox 50 IE No Opera 12 Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 50 Opera Android No Safari iOS 6 Samsung Internet Android 1.0
clear Chrome 13 Edge 12 Firefox 50 IE No Opera 12 Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 50 Opera Android No Safari iOS 6 Samsung Internet Android 1.0
length Chrome 13 Edge 12 Firefox 50 IE No Opera 12 Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 50 Opera Android No Safari iOS 6 Samsung Internet Android 1.0
remove Chrome 31 Edge 12 Firefox 50 IE No Opera 12 Safari 6 WebView Android 4.4.3 Chrome Android 31 Firefox Android 50 Opera Android No Safari iOS 6 Samsung Internet Android 2.0

图例

完整支持
完整支持
不支持
不支持