Answers for "js get copied text"

0

js get copied text

function updateClipboard(newClip) {
  navigator.clipboard.writeText(newClip).then(function() {
    /* clipboard successfully set */
  }, function() {
    /* clipboard write failed */
  });
}
Posted by: Guest on October-17-2020
0

js get copied text

navigator.permissions.query({name: "clipboard-write"}).then(result => {
  if (result.state == "granted" || result.state == "prompt") {
    /* write to the clipboard now */
  }
});
Posted by: Guest on October-17-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language