JavaScript

input Kopyalama

JavaScript

<script>
function copyToClipboard() {
    var textBox = document.getElementById("myvalue");
    textBox.select();
    document.execCommand("copy");
}
</script>    

<input type="text" class="form-control" name="myvalue"  id="myvalue" value="Merhaba Dünya!" readonly  />

<button class="btn btn-primary btn-block" onclick="copyToClipboard('#myvalue')">Copy myvalue</button>

Bir Cevap Yazın

Başa dön tuşu