I want to write a function that can add text into your clipboard and show the added text with your copied text when to paste it.
document.addEventListener('copy', function(e){
e.clipboardData.appendChild(document.createTextNode("hello,world"));
});
<p>I've included the basic site layout so we aren't wasting time creating the form </p>
<p>and making the site looks pretty.</p>
My try failed.
When you copy part of the second line ,for example looks pretty
,and pasted it into a leafpad,it will show:
looks pretty hello,world
instead of
looks pretty