This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

types

Summary

Returns an array listing the formats that were set in the dragstart event. If any files are being dragged, one of the types will be the string "Files".

Property of dom/DataTransferdom/DataTransfer

Syntax

Note: This property is read-only.

var dragTypes = event.dataTransfer.types;

Return Value

Returns an object of type DOM NodeDOM Node

An array of dragged formats.

Examples

//retrieve array of formats being dragged
function getDragTypes(e) {
  var oData = e.dataTransfer;
  var dTypes = oData.types;
}

Related specifications

HTML
Candidate Recommendation

Attributions