const draggableElement = document.querySelector(".draggable-element");
const notDraggableElement = document.querySelector(".not-draggable-element");
// enable the target element's ability to drag
draggableElement.draggable = true;
// disable the target element's ability to drag
notDraggableElement.draggable = false;HTMLElement: draggable property / notebook
HTMLElement: draggable property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.