If we want to make any content of our website drag and drop then we can refer the below code. <!DOCTYPE html> <html> <head> <style> .drag-list { list-style: none; padding: 0; } .drag-item { background-color: #CC56FF; padding: 10px; margin-bottom: 5px; cursor: move; } </style> </head> <body> //Supose that below are the item of our website.… Continue reading Example to make item drag and Drop for Rearrange.
Tag: Draggable HTML Element
How to create a draggable HTML element with JavaScript and CSS
Create a Draggable DIV Element Step 1) Add HTML: Example Code: <!– Draggable DIV –> <div id=”mydiv”> <!– Include a header DIV with the same name as the draggable DIV, followed by “header” –> <div id=”mydivheader”>Click here to move</div> <p>Move</p> <p>this</p> <p>DIV</p> </div> Step 2) Add CSS: The only important style is position: absolute, the rest is… Continue reading How to create a draggable HTML element with JavaScript and CSS