[请教],求助一段“自动复制链接”的 Html 代码,谢谢。 <a href="http://www.xyz.com/file.asp?id=1234" target="_blank" onclick="window.clipboardData.setData('Text',this.innerText)">ID[1234]ID_00.asp</a><br> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 功能一样,但这个有点长<script language="javascript"> function copytburl(obj){var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);alert('该地址已经复制到剪切板');}function sax_getbyid(id) {itm = null;if (document.getElementById) {itm = document.getElementById(id);} else if (document.all) {itm = document.all[id];} else if (document.layers) {itm = document.layers[id];}return itm;}</script> <a href="http://www.baidu.com?id=196" onclick="copytburl(sax_getbyid('url1'))"><span id="url1">ID[1234]ID_00.asp</span></a> 请帮忙看看这个js数据文件是怎么加载的 怎么把一个变量赋值给<embed>标签的src? 如何在UTF-8下实现等宽字体? 关于showModalDialog窗口刷新父页面的问题 高手帮我看看这是什么方式加密的~~~ 试图封装1个FireFox&IE通用的xmlhttprequest对象,碰到头疼的问题 遮罩效果怎么做? javascript and vbscript 请问简单问题 js求表单指定一列数据相加的函数,增加一行数据,结果自动累加并展示在调用窗口 JS怎么和数据库交互 点击弹出对话框的"确定"或"取消"按钮时,提交表单
<script language="javascript">
function copytburl(obj){
var rng = document.body.createTextRange();
rng.moveToElementText(obj);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
alert('该地址已经复制到剪切板');
}
function sax_getbyid(id) {
itm = null;
if (document.getElementById) {
itm = document.getElementById(id);
} else if (document.all) {
itm = document.all[id];
} else if (document.layers) {
itm = document.layers[id];
}
return itm;
}
</script>
<a href="http://www.baidu.com?id=196" onclick="copytburl(sax_getbyid('url1'))">
<span id="url1">ID[1234]ID_00.asp</span></a>