请问为啥document.execCommand("paste")在chrome下不起作用?但是document.execCommand("cut")与document.execCommand("copy")是起作用的
网友回复
由于安全方面的考虑,chrome等现代浏览器不支持调用,因为它可能使恶意的js脚本从你的剪贴板读取敏感数据(例如密码等)

但是除了ie,其他三家都是支持copy与cut的操作的。
这是copy与cut的代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<p>
<textarea id="textarea">Hello, world!</textarea>
</p>
<p>
<button id="copy">复制内容</button> <button id="cut">剪切内容</button>
</p>
<script>
var selectAndCopy = function() {
// Select text
var cutTextarea = document.querySelector('#textarea');
cutTextarea.select();
...点击查看剩余70%


