types property (dataTransfer)
Returns a DOMStringList collection that contains the available data formats for the first item of the current drag-and-drop operation.
Note: The dataTransfer object and its types property are supported in Firefox from version 3.5 and Safari from version 5. Although the types property is supported in Safari 4, it always returns null.
To get the specified formatted data of the first dragged item, use the getData method.The dataTransfer object provides support for dragging multiple items in Firefox. If you need the available data formats for multiple items, use the mozTypesAt method instead of the types property.
You can find the related objects in the Supported by objects section below.
This property is read-only.
A DOMStringList collection that represents the available data formats.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the files property:
Did you find this example helpful?
User Contributed Comments