Chrome paste

by Jools Chadwick

HTML

<textarea rows="5" id="text">Select and copy this text and then click the button to disable.</textarea>
<button id="butt" style='user-select:none'>
Toggle textarea
</button>
<input type="checkbox" id="check" style='user-select:none'>
I'm not important
</button>

JavaScript

var butt = document.getElementById('butt');
var text = document.getElementById('text')
var check = document.getElementById('check')
butt.onmousedown=function(event){
	event.preventDefault()
}
var readOnly = false;
butt.onclick=function(){
	readOnly = text.readOnly=!readOnly;
  check.focus();
}

text.onpaste=function(event){
	console.log(event.type);
	var div = document.createElement('div');
  div.innerHTML = "PASTEY"
	document.body.appendChild(div);
}