Skip to content

Commit e33dd75

Browse files
authored
Copy Text to Clipboard
1 parent b41c868 commit e33dd75

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,18 @@ const unieqNumbers4 = _.uniq(numbers)
158158
console.log(unieqNumbers4) //[1,3,2,5,4,7,8]
159159
160160
```
161+
# Copy Text to Clipboard
162+
163+
164+
```javascript
165+
function copyToClipboard() {
166+
167+
const copyText = document.getElementById("myInput");
168+
copyText.select();
169+
document.execCommand("copy");
170+
171+
}
172+
173+
174+
```
175+

0 commit comments

Comments
 (0)