---
title: "Comment by Diego Ballesteros (Relatable Code) on \"How to copy to clipboard in JavaScript?\" | Hashnode"
description: "Glad it&#39;s being suggested to use the Clipboard API and not the now deprecated one that you sometimes see floating around on &quot;JavaScript Tips&quot; on T"
url: "https://hashnode.com/posts/how-to-copy-to-clipboard-in-javascript/626f7b5da2d355d4df441a5f/comment/626fcf9ffa2b07f7d96a84a2"
---

[Discussion](https://hashnode.com/posts/how-to-copy-to-clipboard-in-javascript/626f7b5da2d355d4df441a5f)

Comment [How to copy to clipboard in JavaScript?](https://hashnode.com/posts/how-to-copy-to-clipboard-in-javascript/626f7b5da2d355d4df441a5f)

[Diego Ballesteros (Relatable Code)](https://hashnode.com/@diegoballesteros)

[May 2, 2022](https://hashnode.com/posts/how-to-copy-to-clipboard-in-javascript/626f7b5da2d355d4df441a5f/comment/626fcf9ffa2b07f7d96a84a2)

Glad it's being suggested to use the Clipboard API and not the now deprecated one that you sometimes see floating around on "JavaScript Tips" on Twitter.

For reference:

```
execCommand('copy')
```

_don't use that_

[Tapas Adhikary](https://hashnode.com/@atapas)

[May 2, 2022](https://hashnode.com/posts/how-to-copy-to-clipboard-in-javascript/626f7b5da2d355d4df441a5f/comment/626fcf9ffa2b07f7d96a84a2#reply-626fd46ffa2b07f7d96a8566)

Absoloutely [Diego](https://hashnode.com/@diegoballesteros)
