1.0.5 • Published 5 years ago

copyme v1.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Copy Me

The Copy Me is a simple JS code which allows you to add a copy event to your code for easy copy in your website or webapp.

How It Works

  • Add the <script src="copyMe.min.js"></script> to your HTML file

  • Create any element you want to copy from giving it an id.

    • E.g <div id='copyMe'>The text here will be copied</div>
  • Create an eventListener on an element that alters the copy Event with a specific id

    - E.g ` <button id='copy'>Copy</button> `

Add This to your JS file

In your js file, add an eventListener listening your element (e.g the button) either (click, mouseover, contextmenu....) . Then call the copyToClipboard() function taking the id of the item(#copyMe) you want to copy as the parameter. Sample Code

document.querySelector('#copy').addEventListener('click', function(){
   copyToClipboard(document.querySelector('copyMe'))
});

OR

Use Source Code Here.

But you need to follow Add This to your JS file step

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago