Source code

Revision control

Copy as Markdown

Other Tools

<?xml version="1.0" encoding="utf-8"?>
<head>
<title>Changing object content during drag and drop of selection</title>
<style type="text/css">
object
{height:100px;
width:300px;
border:solid medium navy;}
</style>
</head>
<body ondragenter="event.preventDefault();document.querySelector('object').setAttribute('data','data:text/plain,Drop%20selection%20outside%20this%20frame')" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
<object type="application/xhtml+xml" data="helper-drag-me-p.xhtml">XHTML document</object>
<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>
</body>
</html>