Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript: (
- function() {
- var text = '[' + document.title + '](' + location.href + ')';
- const input = document.createElement('input');
- document.body.appendChild(input);
- input.value = text;
- input.focus();
- input.select();
- const result = document.execCommand('copy');
- if (result === 'unsuccessful') {
- console.error('Failed to copy text.', result);
- } else {
- console.log('copied', text);
- alert("Copied "+ text);
- }
- }
- )
- ();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement