Wednesday, 9 December 2015

     clipboard.js allow you to directly copy the text to clipboard from data-clipboard-text. If you want to copy the text by clicking a span and copy some entered text to clipboard we can use the following example.

HTML Code

    <div id="btn" data-clipboard-text="This will copy">

        <span>Click here</span>

    </div>

Script

   var clipboard = new Clipboard('#btn');



Example Program:- (Editor)


Editor is Loading...

Advertisement

0 comments:

Post a Comment