Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get copied text

navigator.permissions.query({name: "clipboard-write"}).then(result => {
  if (result.state == "granted" || result.state == "prompt") {
    /* write to the clipboard now */
  }
});
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #copied #text
ADD COMMENT
Topic
Name
1+8 =