There's a Clipboard API for reading and writing to the clipboard, no plugins are needed. It's asynchronous and better for performance than the old technique.
Also note, reading from the clipboard prompts a permission dialog.
The actual code for copying text into the users clipboard is this:
await navigator.clipboard.writeText('hello world')
Optionally, you can get the contents of the users clipboard with this:
await navigator.clipboard.readText() // hello world
If you want better browser support, you can use: