Source code
Revision control
Copy as Markdown
Other Tools
<?xml version="1.0" encoding="utf-8"?>
<head>
<title>Canvas drag and drop: helper file</title>
<style type="text/css">
div
{width:20px;
height:20px;
background-color:green;}
</style>
<script type="application/ecmascript">
function start(event)
{event.dataTransfer.effectAllowed = 'copy';
event.dataTransfer.setData('text/plain', 'green');}
</script>
</head>
<body>
<div draggable="true" ondragstart="start(event)"/>
<p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
</body>
</html>