aurweb/static/js/copy.js
moson-mo 97d0eac303
housekeep: copy static files
we copy static files used by PHP and Python versions into /static

preparation work for the removal of the PHP version

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-04-28 10:53:22 +02:00

9 lines
315 B
JavaScript

document.addEventListener('DOMContentLoaded', function() {
let elements = document.querySelectorAll('.copy');
elements.forEach(function(el) {
el.addEventListener('click', function(e) {
e.preventDefault();
navigator.clipboard.writeText(e.target.text);
});
});
});