First of all, you are trying to select an item by the wrong identifier. Since you are using web forms, the correct way is:
getElementById('<%=TextBox2.ClientID%>')
Also, after the unobtrusive js style, a good solution might look like this:
$().ready(function () { ZeroClipboard.setDefaults({ moviePath: "/Scripts/ZeroClipboard.swf" }); var clip = new ZeroClipboard(document.getElementById('YourButtonId'));
Your button should also have a data-clipboard-target data attribute (there are actually three ways to do this). Setting data attributes for managing web forms is complicated, so you can not use the asp.net button here and do it like this:
<input type="button" value="clickme" id="YourButtonId" data-clipboard-target="<%=TextBox2.ClientID %>"/>
Enjoy it!
source share