mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Not sure where this works, but it doesn't seem to work on my browser. Achieved the same by forEaching through the array returned by querySelectorAll instead. Signed-off-by: Kevin Morris <kevr@0cost.org>
9 lines
315 B
JavaScript
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);
|
|
});
|
|
});
|
|
});
|