I want to use a copy-to-clipboard function in HTML5, but without using flash. Is it possible? How?
I tried to implement a copy-to-clipboad function with JavaScript,
If you don't care that the contents of the text field will be selected prior to copy, here is two-line solution that works at least in Chrome 56 and Edge, but I bet it works in other browsers as well.
function clickListener() {
document.getElementById('password').select();
document.execCommand('copy');
}
document.getElementById('copy_btn').addEventListener('click', clickListener);
https://jsfiddle.net/uwd0rm08/