• Skip to main content
  • Skip to search
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web 开发技术
  2. Web API 接口参考
  3. DataTransfer
  4. DataTransfer()
  • Change language
  • View in English

Table of contents

  • 语法
  • 规范
  • 浏览器兼容性

DataTransfer()

通过构造函数 DataTransfer 创建一个新的 DataTransfer 对象。注意,单独创建该对象没有意义,且Internet Explorer中 DataTransfer 不是一个构造函数。

语法

var dataTrans = new DataTransfer()

参数

无

返回值

一个空的 DataTransfer 对象。

规范

规范 状态 备注
HTML Living Standard
DataTransfer
Living Standard Initial definition.

浏览器兼容性

BCD tables only load in the browser

Found a problem with this page?

  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Apr 16, 2021, by MDN contributors

Change your language

Related Topics

  1. HTML Drag and Drop API
  2. DataTransfer
  3. Constructor
    1. DataTransfer()
  4. 属性
    1. dropEffect
    2. effectAllowed
    3. files
    4. items
    5. This API has not been standardized. mozCursor
    6. This API has not been standardized. mozItemCount
    7. This API has not been standardized. mozSourceNode
    8. This API has not been standardized. mozUserCancelled
    9. types
  5. 方法
    1. This API has not been standardized. addElement()
    2. clearData()
    3. getData()
    4. This API has not been standardized. mozClearDataAt()
    5. This API has not been standardized. mozGetDataAt()
    6. This API has not been standardized. mozSetDataAt()
    7. This API has not been standardized. mozTypesAt()
    8. setData()
    9. setDragImage()
  6. Related pages for HTML Drag and Drop API
    1. DataTransferItem
    2. DataTransferItemList
    3. DragEvent
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

Mozilla

© 2005-2021 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies