Skip to content

Commit

Permalink
Update files/en-us/web/api/clipboard/write/index.md
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Steiner <[email protected]>
  • Loading branch information
chrisdavidmills and tomayac authored Jan 17, 2025
1 parent df4929e commit 32b1c9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/en-us/web/api/clipboard/write/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function setClipboard(text) {
}
```

The `setClipboard()` function specifies a text MIME type in the `type` constant, then specifies a `clipboardItemData` object with a single property — its key is the MIME type, and its value is the passed in text that we want to write to the clipboard. We then construct a new {{domxref("ClipboardItem")}} object into which the `clipboardItemData` object is passed.
The `setClipboard()` function specifies a `"text/plain"` MIME type in the `type` constant, then specifies a `clipboardItemData` object with a single property — its key is the MIME type, and its value is the passed in text that we want to write to the clipboard. We then construct a new {{domxref("ClipboardItem")}} object into which the `clipboardItemData` object is passed.

Finally, `write()` is called with `await` to write the bdata to the clipboard.

Expand Down

0 comments on commit 32b1c9e

Please sign in to comment.