Forum Moderators: open
$('#comment')
.on('beforepaste paste', e => {
...
if (clp) {
// this is the function in question
kill(e);
//////
var type = 'plain';
if (clp.types.indexOf('text/html') !== -1) type = 'html';
a = editClip(clp.getData('text/' + type));
document.execCommand('insertHTML', false, a);
pasted = true;
}
return;
}
...
});
// here's the kill() function
function kill(e) {
if (e.stopPropagation) e.stopPropagation();
e.cancelBubble = true;
if (e.preventDefault) e.preventDefault();
else e.returnValue = false;
return false;
} Assuming that this isn't restricted to jQuery