Skip to content

Commit

Permalink
Use select()
Browse files Browse the repository at this point in the history
  • Loading branch information
jrdnbradford committed Apr 26, 2024
1 parent f47a2e9 commit 655655c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/_static/link_gen/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ function linkMain() {

function copyLink(elementId) {
var copyText = document.getElementById(elementId);
copyText.focus();
copyText.select();
copyText.setSelectionRange(0, copyText.value.length);
navigator.clipboard.writeText(copyText.value);
}

0 comments on commit 655655c

Please sign in to comment.