DEV Community


Posted on

how do you onClick, COPY text? (im making a app)

how do you "copy" the text that's within a class or id?
I want to build a app, that I can add custom snippets to, that I can just click a button... to copy... the snippet to paste.

what would that look like?

Top comments (3)

juneikerc profile image

there are different ways to do that, personally I use navitagor.clipboard but you can also use Document.execCommand.

rishitkhandelwal profile image
Rishit Khandelwal • Edited

Well, navigator.clipboard ig?

Some comments may only be visible to logged-in visitors. Sign in to view all comments.