copy on clipboard working in all browser but not working in safari code is
head>
<title>copy test</title>
</head>
<body>
<button onclick="copier()">Copy</button>
<textarea id="myText">Copy me PLEASE!!!</textarea>
<script>
function copier(){
document.getElementById('myText').select();
document.execCommand('copy');
}
</script>
</body>
</html>
so for safari what i have to do please help me..thanks in advance.
答案 0 :(得分:0)
这适用于“设计模式”。浏览器有效地将文档转换为编辑器。 execCommand API源自IE,后来被添加到HTML5中。确切支持哪些命令,以及它们的行为因浏览器而异。剪贴板访问被视为安全风险。
请查看此link