CactusMC-site/js/copy.js
2024-12-02 18:47:23 -08:00

8 lines
333 B
JavaScript

var copyButton = document.getElementById("copyButton")
var ipField = document.getElementById("ip")
async function copyToClipboard(){
await Navigator.clipboard.writeText(ipField.value)
//im too lazy to go make a proper hovertext thing, il do it later
alert("Copied!")
}
copyButton.addEventListener("click",copyToClipboard)