My requirement: When user copy some content from my web page, with text some HTML tags and carriage retun also gets copied. I need to modify the copied cont
There are two things I can find out.
e
passed not in window
.For further reference copy Event MDN
document.addEventListener('copy', function(e) {
console.log('copied');
e.clipboardData.setData('text/plain', 'Hello World!');
e.preventDefault();
});