I am building a website in html, php, javascript, etc. In that I want to add a specific button, after button clicked the words from input box should get copied into clipboard. I have tried by using Zeroclipboard but I could not.
I have used the following code and added jquery.zclip.js
and jquery-1.8.0.min.js
to the same directory. Welcome for any suggestions.
<head>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script src="jquery.zclip.js"></script>
<style>
#dynamic { font-size: 15px; height: 28px; width: 357px; }
</style>
<script>
$(document).ready(function(){
$("a#copy-dynamic").zclip({
path:"ZeroClipboard.swf",
copy:function(){return $("input#dynamic").val();}
});
});
</script>
</head>
<body>
<input type="text" id="dynamic" value="Copy me !!" />
<a href="#copy" id="copy-dynamic">Copy Now</a>
</body>