You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two large text fields and it would be really cool to have an HTMX button to copy the contents to the clipboard.
I can do this in vanilla JS but was wondering if there is some clever way to do this using inline HTMX.
Any suggestions?
Thanks.
The text was updated successfully, but these errors were encountered:
Just in case you were wondering how to do this in hyperscript (as this is the hyperscript repo), you can see an example on the hyperscript homepage with the CDN link.
<div><codestyle="border: 2px dotted #00000055; margin: 0 10px; padding: 4px 6px; border-radius: 4px"><script src="https://unpkg.com/[email protected]"></script></code><buttonstyle="font:inherit;font-size:.8em;background:#3465a4;color:white;border:none;padding: 0 .4em; border-radius: .4em" _="on click writeText(my previousElementSibling's innerText) on navigator.clipboard put 'copied!' into me wait 1s put 'copy' into me">copy</button></div>
I have two large text fields and it would be really cool to have an HTMX button to copy the contents to the clipboard.
I can do this in vanilla JS but was wondering if there is some clever way to do this using inline HTMX.
Any suggestions?
Thanks.
The text was updated successfully, but these errors were encountered: