我在用
function CopyToClipBoard()
{
clipBoard = document.getElementById('copyTemp');
clipBoard.innerText = document.getElementById('copyFrom').value;
CopiedText = clipBoard.createTextRange();
CopiedText.execCommand("Copy");
clipBoard.innerText = "";
}
用于从浏览器复制文本。点击我需要复制。
<textarea id="copyTemp" style="position: absolute; visibility: hidden;"><?php echo $memMobile; ?></textarea>
<input type="hidden" id="copyFrom" value="<?php echo $memMobile; ?>">
<input type="button" value="Copy" onclick="CopyToClipBoard()">
然后
TypeError: clipBoard.createTextRange is not a function
错误来了