Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. $( document ).ready(function() {
  3.     $(".hostname .fa-copy").on('click', function(event){
  4.         var target = $(event.target);
  5.         var dummyInput = $('<input>')
  6.         $("body").append(dummyInput);
  7.         dummyInput.val(target.parent().text().trim()).select();
  8.         document.execCommand('copy');
  9.         dummyInput.remove();
  10.         var orig = target.css('color');
  11.         target.css('color','#00a0ff');
  12.         setTimeout(function(){
  13.             target.css('color',orig);
  14.         }, 3000);
  15.     });
  16. });
  17. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement