Source code

Revision control

Copy as Markdown

Other Tools

<?xml version="1.0" encoding="utf-8"?>
<head>
<title>Block element drag and drop: changing draggable attribute</title>
<style type="text/css">
div
{width:100px;
height:100px;
background-color:navy;}
</style>
</head>
<body onload="document.querySelector('div').setAttribute('draggable','false')">
<div draggable="true" ondragstart="document.querySelector('p').firstChild.nodeValue = 'FAIL'"/>
<p>You should not be able to drag blue box.</p>
</body>
</html>