Skip to content

Instantly share code, notes, and snippets.

@kenzo-tanaka
Last active March 17, 2021 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenzo-tanaka/011287ceffb5e6a01569c5b716aaa333 to your computer and use it in GitHub Desktop.
Save kenzo-tanaka/011287ceffb5e6a01569c5b716aaa333 to your computer and use it in GitHub Desktop.
javascript: (function () {
const title = document.title;
const textArea = document.createElement("textarea");
textArea.setAttribute("id", "copyTarget");
textArea.value = title;
document.body.appendChild(textArea);
const copyText = document.querySelector("#copyTarget");
copyText.select();
document.execCommand("copy");
textArea.remove();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment