DataTransfer.mozItemCount

This article needs a technical review. How you can help.

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The DataTransfer.mozItemCount property returns the number of items being dragged. This can be used, for example, to get the number of files being dragged.

Note: This property is Gecko-specific.

This property is Read only .

SyntaxEdit

dataTransfer.mozItemCount;

Return value

A number representing the number of items being dragged.

ExampleEdit

This example shows the use of the mozItemCount property.

function drop_handler(event)
{
  var files = [];
  var dt = event.dataTransfer;
  for (var i = 0; i < dt.mozItemCount; i++)
    files.push(dt.mozGetDataAt("application/x-moz-file", i));
}

SpecificationsEdit

This property is not defined in any Web standard.

Browser compatibilityEdit

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
No support (Yes) No support No support No support No support

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

See alsoEdit

Document Tags and Contributors

 Contributors to this page: rolfedh, AFBarstow
 Last updated by: rolfedh,