From b5c821b627f152ea33f3adacb9461fbe7ddf28de Mon Sep 17 00:00:00 2001 From: Chalarangelo Date: Tue, 11 Jan 2022 09:50:51 +0200 Subject: [PATCH] Update copy to clipboard --- .../copy-text-to-clipboard-with-javascript.md | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/blog_posts/copy-text-to-clipboard-with-javascript.md b/blog_posts/copy-text-to-clipboard-with-javascript.md index ae22d791a..64031cbe6 100644 --- a/blog_posts/copy-text-to-clipboard-with-javascript.md +++ b/blog_posts/copy-text-to-clipboard-with-javascript.md @@ -6,37 +6,34 @@ authors: chalarangelo cover: blog_images/typing.jpg excerpt: Learn how to programmatically copy text to clipboard with a few lines of JavaScript and level up your web development skills. firstSeen: 2020-01-20T11:41:23+02:00 -lastUpdated: 2021-06-12T19:30:41+03:00 +lastUpdated: 2022-01-11T09:47:54+03:00 --- -### Core functionality +### Asynchronous Clipboard API -A very common need when building websites is the ability to copy text to clipboard with a single button click. Javascript can easily do this in five short steps: +A very common need when building websites is the ability to copy text to clipboard with a single button click. If you only need to support modern browsers, it's highly recommended to use the asynchronous [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API). It's supported in all modern browsers and provides an easy and secure way to update the clipboard's contents. -1. Create a`