Copy Text Tutorial Using Clipboard API (JavaScript)

Опубликовано: 29 Сентябрь 2024
на канале: Nsquared Coding
4,211
59

In this video we will use the clipboard api which has a method writeText that is will copy any string you pass into the function into the clipboard and be able to paste it anywhere. It is really easy to setup and use.
We will also use bootstrap to show a toast notification letting the user know the text was copied. Also show an alternative of simply changing the text of the button from Copy to Copied back to Copy to let the user know it was copied. Take your pick!

00:00 Intro & Demo
1:33 VS Code Setup & HTML
4:40 Implement Copy Functionality In JavaScript
7:15 Ways to Notify User Text is Copied Using Bootstrap
12:30 IE11 Compatibility
12:57 Please Like & Subscribe!