Answers for "get everything single text from clipboard javascript"

17

how to copy text in the clipboard in js

<html>
  <input type="text" value="Hello world"(Can be of your choice) id="myInput"(id is the name of the text, you can change it later)
<button onclick="Hello()">Copy Text</button>

<script>
  function Hello() {
  var copyText = document.getElementById('myInput')
  copyText.select();
  document.execCommand('copy')
  console.log('Copied Text')
}
</script>
Posted by: Guest on October-14-2020
6

copy text to clipboard javascript without input

navigator.clipboard.writeText('the text')
Posted by: Guest on July-16-2021

Code answers related to "get everything single text from clipboard javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language