Skip to content

Commit f128962

Browse files
committed
Fix: clipboard button not working
Resolved issue with non-functional clipboard button on homepage.
1 parent f2f936d commit f128962

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

layouts/partials/footer.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,18 @@
2121
</div>
2222
</div>
2323
</footer>
24+
25+
<!-- JavaScript code -->
26+
<script>
27+
document.getElementById('copy-button').addEventListener('click', () => {
28+
const curl = document.getElementById('curl');
29+
const range = document.createRange();
30+
range.selectNodeContents(curl);
31+
window.getSelection().removeAllRanges();
32+
window.getSelection().addRange(range);
33+
document.execCommand('copy');
34+
});
35+
</script>
36+
2437
</body>
2538
</html>

0 commit comments

Comments
 (0)