The DataTransferItem
object represents one drag data item. During a drag operation, each drag event
has a dataTransfer
property which contains a list
of drag data items. Each item in the list is a DataTransferItem
object.
This interface has no constructor.
DataTransferItem.kind
Read only
string
or file
.DataTransferItem.type
Read only
DataTransferItem.getAsFile()
File
object associated with the drag data item (or null if the drag item is not a file).DataTransferItem.getAsString()
DataTransferItem.webkitGetAsEntry()
FileSystemEntry
representing the selected file's entry in its file system. This will generally be either a FileSystemFileEntry
or FileSystemDirectoryEntry
object.All of this interface's methods and properties have their own reference page, and each reference page has an example of its usage.
Specification | Status | Comment |
---|---|---|
WHATWG HTML Living Standard The definition of 'DataTransferItem' in that specification. | Living Standard | Initial definition. |
HTML5.1 The definition of 'DataTransferItem' in that specification. | Recommendation | W3C snapshot of WHATWG |
File and Directory Entries API The definition of 'DataTransferItem.webkitGetAsEntry()' in that specification. | Editor's Draft | Definition of webkitGetAsEntry() as part of the File and Directory Entries API. |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | 4 | (Yes) | 50 (50) | No support | 12 | No support |
Feature | Android | Android Webview | Chrome for Android | Edge | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|---|---|
Basic support | No support | No support | No support | ? | 50.0 (50) | No support | No support | No support | No support |
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem