Tagged: js

0

How copy to the clipboard.

Original Code (ES5) var copyBtn = document.getElementById(‘copyBtn’); copyBtn.addEventListener(‘click’, function() { var copyTxt = document.getElementById(‘copyTxt’); copyTxt.focus(); copyTxt.select(); document.execCommand(‘copy’); });   Fixed...