mirror of
https://github.com/TrentSPalmer/fcc-challenges.git
synced 2024-11-24 04:11:30 -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();
|
||
|
}
|