routeros-scripts-main/general/clipboard.js
Christian Hesse 699be25b64 general/clipboard: use textContent...
... and avoid having html entity encoded characters in clipboard.
2025-11-20 20:44:56 +01:00

8 lines
254 B
JavaScript

/* copy code to clipboard */
function CopyToClipboard(element) {
element.style.filter = 'invert(1)';
navigator.clipboard.writeText(element.firstElementChild.textContent);
setTimeout(function() {
element.style.filter = 'invert(0)';
}, 100);
}