mirror of
https://github.com/TrentSPalmer/fcc-challenges.git
synced 2024-11-25 04:31:29 -08:00
8 lines
187 B
JavaScript
8 lines
187 B
JavaScript
|
function copyToClipboard(element) {
|
||
|
var $temp = $("<textarea>");
|
||
|
$("body").append($temp);
|
||
|
$temp.val($(element).text()).select();
|
||
|
document.execCommand("copy");
|
||
|
$temp.remove();
|
||
|
}
|