Advertisement
Home Open Editor ❯

HTML ondrop event Attribute

Example

<div ondrop="myFunction(event)"></div>

Meaning

The ondrop attribute specifies the script to be run when dragged element is being dropped.

Note: To make an element draggable, use the global HTML5 draggable attribute.

Tip: A links and images are draggable by default there is no need of draggable attribute.


Standard Syntax

<element ondrop="script">


Advertisement

Attribute Values

Value Description
script Specifies the script to be run on ondrop

Technical Details

Supported HTML elements:

ALL HTML elements
Home Open Editor ❯
Advertisement