Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js copy input value to clipboard

<input type="text" placeholder="Create Password" id="text" readonly>
<script>
  function copyPassword(){
    var copyText = document.getElementById('text')
    copyText.select()
    copyText.setSelectionRange(0, 999)
    document.execCommand("copy")
    console.log(copyText);
  }
</script>
 
PREVIOUS NEXT
Tagged: #js #copy #input #clipboard
ADD COMMENT
Topic
Name
8+5 =