How TO - Copy Text to Clipboard / Website Design

Learn how to use JavaScript to copy text to the clipboard.

copy to clipboard html jquery copy to clipboard copy to clipboard javascript bootstrap copy to clipboard highlight js copy to clipboard react copy to clipboard angular copy to clipboard javascript copy to clipboard without input


READ ALL THE STEPS PROPERLY

To copy the text from the text area, click the button.

EXAMPLE:-

 

Whatever your life's work is, do it well. A man should do his job so well that the living, the dead, and the unborn could do it no better.

 

 

MORE QUOTES READ HERE...

STEP 1) ADD CSS LINK AND JAVASCRIPT

  <link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet" type="https://drive.google.com/uc?export=download&id=1mDtDngZaIq7fnAdNaXK3_EJ2Jvb-rY-6"></link><link></link>  
 <script> function copyToClipboard(element) {  var $temp = $("<input>");  $("body").append($temp);  $temp.val($(element).text()).select();  document.execCommand("copy");  $temp.remove(); } </script>  
 

Step 2) Add HTML

 <h3><blockquote id="p1" p="" style="color: grey; font-size: 20px; text-align: center;">  
  "PASTE YOUR SENTENCES OR ARTICLE HERE"</blockquote> </h3>  
<div><button class="button" onclick="copyToClipboard('#p1')">Copy </button> <div>
  •  IF YOU DON'T REQUIRED BLOCKQUOTE FORM THEN COPY THE BELOW HTML CODE👇👇
 <h3><id="p1" p="" style="color: grey; font-size: 20px; text-align: center;">  
  "PASTE YOUR SENTENCES OR ARTICLE HERE" </h3>  
 <div><button class="button" onclick="copyToClipboard('#p1')">Copy </button> <div>  

  • IF YOU WANT TO GIVE THIS COPY BUTTON 2 OR 3 TIMES AT THE SAME POST  OR MORE ... THEN FOLLOW THE STEPS...
FOR THE SAME PAGE OR SAME POST
  1. Change the "id"="p1" AND ('#p1') Number; For Second Copy Button At the same post or same page then "id"="p2" AND ('#p2') IF there third Button at the same post then "id"="p3" AND ('#p3') And So on...



Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

buttons=(Accept !) days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !