Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE HTML>
<html>
<head>
<style>
#div1, #div2
{
float: left;
width: 90px;
height: 70px;
margin: 10px;
padding: 10px;
border: 1px solid orange;
}
#div3
{
width: 50px;
height: 30px;
margin: 10px;
padding: 10px;
background-color: orange;
position: fixed;
}
</style>
<script>
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>
YOU CAN DRAG AND DROP THE SQUARE
<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)">
<div id="div3" draggable="true" ondragstart="drag(event)"></div>
</div>
<div id="div2" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 6K 508