HTML5中的复制
<input type="text" id="txtUrl" value="http://www.baidu.com" readonly="readonly" onclick="this.blur();" />
<img src="~/Images/fz.png" onclick="copy()" />
<script>
function copy() {
var copyTarget = document.getElementById('txtUrl');
copyTarget.select();
try {
document.execCommand("Copy");
alert("复制成功!");
}
catch (err) {
alert("您的系统暂时不支持复制,我们正在努力改进");
}
}
</script>