<script type="text/javascript">
function EL(id) {
return document.getElementById(id);
}function CPos(x, y) {
this.x = x;
this.y = y;
}function GetPos(o) {
var or = o.getBoundingClientRect();
return new CPos(or.left, or.top);
}function CopyBox(o, value) {
var p = GetPos(o);
EL("cbx").style.position = "absolute";
EL("cbx").style.left = (p.x - 2) + (document.documentElement.scrollLeft || document.body.scrollLeft || 0) + "px";
EL("cbx").style.top = (p.y - 2) + (document.documentElement.scrollTop || document.body.scrollTop || 0) + "px";
setTimeout("SetVar('"+value+"')", 1);
}function SetVar(value) {
document["cbs"].SetVariable("content", value);
}function Click(id) {
EL(id).className = "copyselected";
}
</script>
无法实现copy了
<span id="p1" class="copy" onmouseover="CopyBox(this, 'p1:98.202.142.76:8080');"> 
copy按钮代码