I'm trying to get a copy button on my html page but it won't work - in the chrome console it states nothing, it just won't copy the text.
this is my html:
<!doctype html>
<div class="ipDiv tk-saffran">
<div class="ipText">
<h2 id="ip">play.MineGlade.net</h2>
</div>
<div class="copyButton">
<button onclick="copyIp()">Copy IP</button>
<script>
function copyIp() {
var copyText = document.getElementById("ip");
copyText.select;
document.execCommand("Copy");
}
</script>
</div>
</div>
how do I fix this?