You can use the clipboard controller to copy text to the clipboard (with tooltips on success).
Add data-controller="clipboard" data-clipboard-text="Text for clipboard"
to the element.
<button class="btn btn-primary" data-controller="clipboard" data-clipboard-text="Hello from Jumpstart Pro!">Copy to Clipboard</button>