<?xml version="1.0" encoding="utf-8"?> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<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> |