+ 1

Please who can explain this code to me

<body> <div id="box" ondrop="drop(event)" ondragover="allowDrop(event)" style="border:1px solid black; width:200px; height:200px"></div> <img id="image" src="sample.jpg" draggable="true" ondragstart="drag(event)" width="150" height="50" alt="" /> </body>

3rd Feb 2022, 5:19 PM
TescoVision
TescoVision - avatar
1 Answer
+ 2
What in particular? This represents rectangle and image under it. ondrop and ondragover are event listeners and triggers the function with the name in quotes.
3rd Feb 2022, 5:31 PM
cadbrooke
cadbrooke - avatar