日期:2014-05-16 浏览次数:20441 次
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="js/jquery-1.8.0.min.js"></script>
<script src="js/ZeroClipboard.js"></script>
<title></title>
<script type="text/javascript">
function $(id) { return document.getElementById(id); }
function toClipboard(copy_id, input_id) {
var clip = new ZeroClipboard.Client();
clip.setHandCursor(true);
clip.setText($(input_id).value);
clip.addEventListener('complete', function (client) {
alert("Copy Ok!");
});
clip.glue(copy_id);
}
</script>
</head>
<body>
<input type="text" id="input_text" />
<input id="copy_button" type="button" value="copy" onmouseOver="toClipboard(this.id,'input_text')" />
<br/>
<input type="text" id="input_text2" />
<input id="copy_button2" type="button" value="copy" onmouseOver="toClipboard(this.id,'input_text2')"/>
<br/>
<input type="text" id="input_text3" />
<input id="copy_button3" type="button" value="copy" onmouseOver="toClipboard(this.id,'input_text3')"/>
</body>
</html>