Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

DataTransferItemList

我們的志工尚未將此文章翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!

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 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.

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
WHATWG HTML Living Standard
The definition of 'DataTransferItemList' in that specification.
Living Standard  
HTML5.1
The definition of 'DataTransferItemList' in that specification.
Working Draft Not included in W3C HTML5 Recommendation

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 4 50 (50) No support 12 No support
Feature Android Android Webview Chrome for Android 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

[1]Partial support refers to not supporting .setDragImage [CanIUse.com]

文件標籤與貢獻者

 此頁面的貢獻者: Sheppy, rolfedh, lian79, AFBarstow
 最近更新: Sheppy,