Advertisement
Home Open Editor ❯

HTML ondragover Attribute

Example

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

Meaning

The ondragover attribute specifies the script to be run when an element is being dragged over a valid drop target.

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 ondragover="script">


Applies to:

The ondragover attribute can be used on the following element:

Element Attribute
All HTML elements ondragover

Advertisement

Attribute Values

Value Description
script Specifies the script to be run on ondragover
Home Open Editor ❯
Advertisement