Created
March 23, 2023 15:58
-
-
Save JulaineScott/dabd3283c978aa8e61cfd002919485ce to your computer and use it in GitHub Desktop.
Copy To Clipboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const input = document.querySelector('input'); | |
const btn = document.querySelector('button'); | |
btn.addEventListener('click', () => { | |
navigator.clipboard.writeText(input.value); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment