Вот мой код:не может получить document.execCommand правильно работать с копированием текста
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")
Теперь, когда я пытаюсь вставить текст я поместил в текстовое поле не отображается. Кто-нибудь знает, что я делаю неправильно?