Skip to content

Commit cfec609

Browse files
authored
update Copy Text to Clipboard
1 parent e33dd75 commit cfec609

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ function copyToClipboard() {
169169
document.execCommand("copy");
170170
171171
}
172-
172+
//new API
173+
function copyToClipboard(){
174+
navigator.clipboard.writeText(document.querySelector('#myInput').value)
175+
}
173176
174177
```
175178

0 commit comments

Comments
 (0)