I want the text of the 'div' to change to "copied!" for only a couple of seconds and get back the original text after that particular time period.
This is a sample of the code:
<!DOCTYPE html>
<html lang="en">
<body
<div class="row">
<div class="box col-xs-2 btn red1 integration-checklist__copy-button" id="#E44236" data-clipboard-text="#E44236"><p>#E44236</p></div>
<script>
var clipboard = new ClipboardJS('.btn');
clipboard.on('success', function(e) {
e.clearSelection();
e.trigger.textContent = 'Copied!';
});
clipboard.on('error', function(e) {
console.info(e);
});
</script>
You need to use setInterval to achieve this. The code below runs the "timer" function 1000 milliseconds after you've copied the text. Feel free to change that value to whatever you prefer.