No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
dev:DiscordIntegrator/code.js |
dev:DiscordIntegrator/code.js |
||
+ | |||
dev:CopyText/code.js |
dev:CopyText/code.js |
||
$('body').on('click', '.copy-to-clipboard-button', function(e){ |
$('body').on('click', '.copy-to-clipboard-button', function(e){ |
Latest revision as of 08:32, 2 October 2018
dev:DiscordIntegrator/code.js
dev:CopyText/code.js $('body').on('click', '.copy-to-clipboard-button', function(e){
var text = $(this).data('text'), $input = $('<input>', { type: 'text' }) .val($('.copy-to-clipboard-text[data-text="' + text + '"]').first().text()) .appendTo('body') .select(); document.execCommand('Copy'); $input.remove();
});