Source code

Revision control

Copy as Markdown

Other Tools

<?xml version="1.0" encoding="utf-8"?>
<title>Removing iframe during drag and drop of selection</title>
<style type="text/css">
border:solid medium navy;}
<body ondragenter="event.preventDefault();document.querySelector('body').removeChild(document.querySelector('iframe'))" ondragover="return false" ondrop="document.querySelector('p').firstChild.nodeValue = (event.dataTransfer.getData('text/plain') == 'Drag me')?'PASS':'FAIL'">
<iframe src="helper-drag-me-p.xhtml">XHTML document</iframe>
<p>Drag selection above out of frame and drop it somewhere on the page. You should see word PASS once you drop it.</p>