---
title: DataTransfer()
slug: Web/API/DataTransfer/DataTransfer
tags:
  - API
  - Constructor
  - DataTransfer
  - HTML Drag and Drop API
  - Reference
  - drag and drop
browser-compat: api.DataTransfer.DataTransfer
---
{{APIRef("HTML Drag and Drop API")}}

The **`DataTransfer`** constructor creates a new
{{domxref("DataTransfer")}} object instance.

## Syntax

```js
var dataTrans = new DataTransfer()
```

### Parameters

None.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
