Here is my code:
function createTextArea() {
var t = document.createElement("textArea");
textArea = document.body.appendChild(t);
return textArea;
}
function copy(str) {
var textArea = createTextArea();
textArea.value = str;
textArea.select();
document.execCommand("Copy");
}
copy("hello")
Now, when I try to paste, the text I placed into the textarea is not appearing. Does anyone know what I'm doing wrong?