<input type="text" value="Hello World" id="kopyala">
<button onclick="myFunction()">Copy text</button>
<script>
function myFunction() {
var copyText = document.getElementById("kopyala");
copyText.select();
copyText.setSelectionRange(0, 99999)
document.execCommand("copy");
}
</script>