1.

Calling the ______________ method during both a dragenter and dragover event will indicate that a drop is allowed at that location.(a) drop(b) drag(c) preventDefault(d) dataTransferI have been asked this question in an interview for internship.I would like to ask this question from Drag and Drop in division HTML Fonts, Tags and Elements of HTML

Answer»

Correct option is (c) preventDefault

To EXPLAIN: The DROP EVENT is fired on the element where the drop occurred at the end of the drag operation. When element is being DRAGGED, drag event has happened. Calling the preventDefault method during both a dragenter and dragover event will indicate that a drop is allowed at that location. However, you will commonly wish to call the preventDefault method only in certain situations, for example, only if a LINK is being dragged. The dataTransfer property of all drag events holds data about the drag and drop operation.



Discussion

No Comment Found

Related InterviewSolutions