Licence
ISC
Version
0.0.3
Deps
0
Size
3 kB
Vulns
0
Weekly
0
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();
});