mirror of
https://github.com/TrentSPalmer/fcc-challenges.git
synced 2024-10-04 18:34:56 -07: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();
|
||
|
}
|