The documentation has a complete example on how you could set this up. If we suppose that you use Razor:
<html>
<body>
<button id="copy-button" data-clipboard-text="Copy Me!" title="Click to copy me.">Copy to Clipboard</button>
<script src="@Url.Content("~/scripts/ZeroClipboard.js")"></script>
<script type="text/javascript">
var pathToSWF = '@Url.Content("~/scripts/ZeroClipboard.swf")';
</script>
<script src="@Url.Content("~/scripts/main.js)""></script>
</body>
</html>
And then inside your main.js
:
// main.js
var clip = new ZeroClipboard( document.getElementById("copy-button"), {
moviePath: pathToSWF
} );
clip.on( 'load', function(client) {
// alert( "movie is loaded" );
} );
clip.on( 'complete', function(client, args) {
this.style.display = 'none'; // "this" is the element that was clicked
alert("Copied text to clipboard: " + args.text );
} );
clip.on( 'mouseover', function(client) {
// alert("mouse over");
} );
clip.on( 'mouseout', function(client) {
// alert("mouse out");
} );
clip.on( 'mousedown', function(client) {
// alert("mouse down");
} );
clip.on( 'mouseup', function(client) {
// alert("mouse up");
} );