copy-text-to-clipbord
v0.0.3
Published
A tiny tool for copying text in a h5 page
Downloads
8
Readme
copy-text-to-clipbord
A tiny copy tool for copying text in a h5 page
install
npm install copy-text-to-clipbord --save
usage example
/html
<div id='clkBtn'></div>
/js
var TinyCopy = require('copy-text-to-clipbord');
var copyAction = new TinyCopy({
selectText:'hehe'
});
copyAction.on('sucess',function(e){
console.log('success', e.selextText); // 'success hehe'
});
copyAction.on('fail',function(){
console.log('fail');
});
document.querySelector('#clkBtn').addEventListener('click',function(){
copyAction.copy();
});