<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script>
function copy(id,src)
{
var $copy=document.body.createControlRange();
var $img =$("<img id="+id+" src="+src+" width='4' height='5'/>").appendTo("body");
var $this = document.getElementById(id);
if ($this.tagName != 'IMG')
return;
if (typeof $this.contentEditable == "undefined")
return;
if (!document.body.createControlRange)
return;
$this.contentEditable = true;
$copy.addElement($this);
$copy.execCommand("Copy");
$this.contentEditable = false;
$('body').find("#"+id).remove();
alert("复制完成");
}
</script>
</HEAD>
<BODY>
<img src="http://www.baidu.com/img/baidu_sylogo1.gif" />
<button οnclick="copy('101','http://www.baidu.com/img/baidu_sylogo1.gif');"> 复制</button>
</BODY>
</HTML>