How to copy text from php file to clipboard using jquery

Hey Pal,

Worried about copying text/link to clipboard? No worries dude..its mere simple as switching a light on 😉

There are many ways to achieve this ever i followed zclip..

Download zclip.js from this link

Place <script src=”js/jquery.zclip.js”/></script> in head tag


<a href=”” data-copy=”<?php echo $v;?>” class=”copy” class=”list-group-item”><?php
print “$v”; ?></a>


$(“a.copy”).on(‘click’, function (e) {
}).each(function () {
path: ‘;,
copy: function() {
return $(this).data(‘copy’);

Now execute your can see an alert showing your copied text to clipboard. Enjoy 😉

Get complete zeroclipboard from github


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s