Answers for "copy url button css"

2

javascript copy to clipboard

$(document).ready(function(){
	$("#ewefmwefmp").click(function(){
    //alert()
      var copyText = document.getElementById("myInput");
      copyText.select();
      copyText.setSelectionRange(0, 99999)
      document.execCommand("copy");
      alert("Copied the text: " + copyText.value);
    
    });
});
Posted by: Guest on September-09-2020
0

how to make a button that paste text in a textbox html

<!DOCTYPE html>
<html>
 <head>
   <script>
     function paste() {
            var pasteText = document.querySelector("#text");
            pasteText.focus();
            document.execCommand("paste");

            pasteText.value = pasteText.value + pasteText.value;
        }
   </script>
  </head>
  <body>
    <input id="text">
    <button onclick="paste()">Paste</button>
   </body>
Posted by: Guest on September-23-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language