Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- copyText(str){
- const el = document.createElement('textarea');
- el.value = str;
- el.setAttribute('readonly', '');
- el.style.position = 'absolute';
- el.style.left = '-9999px';
- document.body.appendChild(el);
- el.select();
- document.execCommand('copy');
- document.body.removeChild(el);
- alert('wechat id copied successfully')
- // navigator.clipboard.writeText(copyText);
- // alert('wechat id copied successfully')
- },
Add Comment
Please, Sign In to add comment