Based on the clipBoard. JS plug-in, js achieves cutting, copying, and pasting. jsclipboard. js

Source: Internet
Author: User

Based on the clipBoard. JS plug-in, js achieves cutting, copying, and pasting. jsclipboard. js

Abstract:

Recently, a project was created, with the following requirement: to implement the function of clicking the button to copy the link, find relevant information online, and find several plug-ins, zeroClipboard is a replication function implemented through flash. As more and more proposals are made to abolish flash, I want to see if I can achieve replication and cutting through js?

Address: https://github.com/baixuexiyang/clipBoard.js

Method:

Copy

var copy = new clipBoard(document.getElementById('data'), {beforeCopy: function() {},copy: function() {return document.getElementById('data').value;},afterCopy: function() {}}); 

Cut

var cut = new clipBoard(document.getElementById('data'), {beforeCut: function() {},Cut: function() {return document.getElementById('data').value;},afterCut: function() {}});

Paste

var paste = new clipBoard(document.getElementById('data'), {beforePaste: function() {},paste: function() {return document.getElementById('data').value;},afterPaste: function() {}});

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.