Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript copy site url to clipboard

const button = document.querySelector('button')
button.onclick = () => {
  navigator.clipboard.writeText(window.location.href);
}
Source by thewebdev.info #
 
PREVIOUS NEXT
Tagged: #javascript #copy #site #url #clipboard
ADD COMMENT
Topic
Name
2+2 =