Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how copy url of page to clipboard javascript

var $temp = $("<input>");
var $url = $(location).attr('href');

$('.clipboard').on('click', function() {
  $("body").append($temp);
  $temp.val($url).select();
  document.execCommand("copy");
  $temp.remove();
  $("p").text("URL copied!");
})
Source by codepen.io #
 
PREVIOUS NEXT
Tagged: #copy #url #page #clipboard #javascript
ADD COMMENT
Topic
Name
4+3 =