From 2c07a48313a835e7f5e32b5eb0349d48c2274b6a Mon Sep 17 00:00:00 2001 From: Kiril Kovachev Date: Mon, 14 Oct 2024 11:22:40 +0100 Subject: [PATCH] Add script to copy kanji on click --- kanken_online/static/kanji.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 kanken_online/static/kanji.js diff --git a/kanken_online/static/kanji.js b/kanken_online/static/kanji.js new file mode 100644 index 0000000..afc9db4 --- /dev/null +++ b/kanken_online/static/kanji.js @@ -0,0 +1,4 @@ +const kanjiElem = document.getElementById("kanji"); +kanjiElem.addEventListener("click", (_) => { + navigator.clipboard.writeText(kanjiElem.innerText); +}); \ No newline at end of file