Butona tıklayınca panoya kopyalama
2
●304
- 18-10-2020, 00:15:57
<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>
- 18-10-2020, 00:16:48
<button onclick="myFunction()">Copy text</button> function myFunction() { /* Get the text field */ var copyText = document.getElementById("myInput"); /* Select the text field */ copyText.select(); copyText.setSelectionRange(0, 99999); /*For mobile devices*/ /* Copy the text inside the text field */ document.execCommand("copy"); /* Alert the copied text */ alert("Copied the text: " + copyText.value); }
Dipnot : Html ve JavaScript bilmiyorum. Google Biliyorum