The 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.
Properties
DataTransferItemList.length
Read only- An
unsigned long
that is the number of drag items in the list.
Methods
DataTransferItemList.add()
- Adds an item (either a
File
object or astring
) to the drag item list and returns aDataTransferItem
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.
Example
Each of this interface's methods and properties has a reference page, and each reference page has an example of its usage.
Specifications
Specification | Status | Comment |
HTML Living StandardThe definition of 'DataTransferItemList' in that specification. | Living Standard | |
HTML 5.1The definition of 'DataTransferItemList' in that specification. | Recommendation | Not included in W3C HTML5 Recommendation |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
DataTransferItemList
|
Chrome
Full support 13 |
Edge
Full support 12 |
Firefox
Full support 50 |
IE
No support No |
Opera
Full support 12 |
Safari
Full support 6 |
WebView Android
Full support 4.4 |
Chrome Android
Full support 18 |
Firefox Android
Full support 50 |
Opera Android
No support No |
Safari iOS
Full support 6 |
Samsung Internet Android
Full support 1.0 |
DataTransferItemList[]
|
Chrome
Full support 13 |
Edge
Full support ≤79 |
Firefox
Full support 50 |
IE
No support No |
Opera
Full support 12 |
Safari
Full support 6 |
WebView Android
Full support 4.4 |
Chrome Android
Full support 18 |
Firefox Android
Full support 50 |
Opera Android
No support No |
Safari iOS
Full support 6 |
Samsung Internet Android
Full support 1.0 |
add
|
Chrome
Full support 13 |
Edge
No support 12 — 79 |
Firefox
Full support 50 |
IE
No support No |
Opera
Full support 12 |
Safari
Full support 6 |
WebView Android
Full support 4.4 |
Chrome Android
Full support 18 |
Firefox Android
Full support 50 |
Opera Android
No support No |
Safari iOS
Full support 6 |
Samsung Internet Android
Full support 1.0 |
clear
|
Chrome
Full support 13 |
Edge
Full support 12 |
Firefox
Full support 50 |
IE
No support No |
Opera
Full support 12 |
Safari
Full support 6 |
WebView Android
Full support 4.4 |
Chrome Android
Full support 18 |
Firefox Android
Full support 50 |
Opera Android
No support No |
Safari iOS
Full support 6 |
Samsung Internet Android
Full support 1.0 |
length
|
Chrome
Full support 13 |
Edge
Full support 12 |
Firefox
Full support 50 |
IE
No support No |
Opera
Full support 12 |
Safari
Full support 6 |
WebView Android
Full support 4.4 |
Chrome Android
Full support 18 |
Firefox Android
Full support 50 |
Opera Android
No support No |
Safari iOS
Full support 6 |
Samsung Internet Android
Full support 1.0 |
remove
|
Chrome
Full support 31 |
Edge
Full support 12 |
Firefox
Full support 50 |
IE
No support No |
Opera
Full support 12 |
Safari
Full support 6 |
WebView Android
Full support 4.4.3 |
Chrome Android
Full support 31 |
Firefox Android
Full support 50 |
Opera Android
No support No |
Safari iOS
Full support 6 |
Samsung Internet Android
Full support 2.0 |
Legend
- Full support
- Full support
- No support
- No support
DataTransferItemList by Mozilla Contributors is licensed under CC-BY-SA 2.5.