Source code

Revision control

Copy as Markdown

Other Tools

<?xml version="1.0" encoding="utf-8"?>
<head>
<title>Dropping selection from text input into readonly text input</title>
<style type="text/css">
input
{padding:1em;
width:300px;}
</style>
</head>
<body onload="document.querySelector('input').select()">
<p><input value="Drag me"/></p>
<p>Try to drag selected text into the input below. You should not be able to drop it here.</p>
<p><input readonly="readonly" placeholder="Try to drop selected text here" onchange="document.querySelector('p+p').firstChild.nodeValue = 'FAIL'"/></p>
</body>
</html>