Ion Vasile Ion Vasile - 1 year ago 127
Javascript Question

dragDrop javascript function name reserved in Microsoft Edge?

Why if I use a

event function name in microsoft edge will not work?


#div1 {
width: 350px;
height: 70px;
padding: 10px;
border: 1px solid #aaaaaa;
function allowDrop(ev) {

function drag(ev) {

function dragDrop(ev) {
var data = ev.dataTransfer.getData("text");;

<p>Drag the W3Schools image into the rectangle:</p>

<div id="div1" ondrop="dragDrop(event)" ondragover="allowDrop(event)"></div>
<img id="drag1" src="img_logo.gif" draggable="true" ondragstart="drag(event)" width="336" height="69">


Answer Source

Inside an inline event handler, the element's DOM object is in the scope chain.

Elements in Edge have a dragDrop() method, so you're calling that.

This is why you should never use inline event handlers.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download