<meta charset="utf-8" />
<button id="d_clip_button" data-clipboard-target="fe_text" >点击复制</button>
<input id="fe_text" value="Testing text." />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="ZeroClipboard.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
ZeroClipboard.setDefaults({
moviePath: "ZeroClipboard.swf"
});
var clip = new ZeroClipboard($("#d_clip_button"));
clip.on("load", function(client) {
console.log("ZeroClipboard.");
client.on("complete", function(client, args) {
console.log("内容己复制 :" + args.text);
});
});
});
</script>