Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

copy to clipboard

methods: {
  async copyURL(mytext) {
    try {
      await navigator.clipboard.writeText(mytext);
      alert('Copied');
    } catch($e) {
      alert('Cannot copy');
    }
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #copy #clipboard
ADD COMMENT
Topic
Name
8+6 =