【发布时间】:2013-12-08 21:09:17
【问题描述】:
这是我的代码:
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")
现在,当我尝试粘贴时,我放入 textarea 的文本没有出现。有谁知道我做错了什么?
【问题讨论】:
标签: javascript browser copy-paste