JSFiddle - React, Tailwind, and code Playground
by brunogc
HTML
<input id=password value="test" type="hidden">
<button id=copy_btn>Copy</button>
CSS
testtest
test
JavaScript
function clickListener() {
document.getElementById('password').select();
document.execCommand('copy');
}
document.getElementById('copy_btn').addEventListener('click', clickListener);