Buy Plus UI v2.6! Demo Buy Now!

Adding Double Tap to Copy for Syntax Highlighter - CodeBox

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

So Hello viewers and visitors welcome to Tech Aadi another article. How are you, I hope you guys are doing good and great.

Adding Double Tap to Copy for Syntax Highlighter - CodeBox

Have you written any article while instructing code for your viewers to help them. Then you must know that for long codes the visitors may have got problem with the codes you have given.

Because the codes they will use they have to select and then copy it. But what if they will just double tab it and the codes in the box will be automatically copied.

Yeah that right what you read. Today we are going to Add Double Tab to Copy for Syntax Highlighter or CodeBox.

So let's start the adding process.

Before starting as always do backup your blog template for any kind of error and easy restoration.

Adding Double Tap to Copy for Syntax Highlighter

There is only one step you have to do so just be patience and follow the article till last. You won't regret it adding in your blog. Because it is very useful for Blogger's with tips and tutorials.

Steps

  1. Login to your Blogger dashboard.
  2. Click on theme section then edit HTML.
  3. Then search for this code </body> tag.
  4. Copy and paste the below given code just before the </body> tag.
<!--[ Double click to Copy ]-->
<script>/*<![CDATA[*/ for(var preclick=document.getElementsByTagName('pre'),i=0;i<preclick.length;i++)preclick[i].addEventListener('dblclick',function(){var e=getSelection(),t=document.createRange();t.selectNodeContents(this),e.removeAllRanges(),e.addRange(t),document.execCommand('copy'),this.classList.add('copied'),setTimeout(()=>{window.getSelection().removeAllRanges(),this.classList.remove('copied')},4e3)},!1); /*]]>*/</script>

Now click on save theme.

So after doing above steps I hope you have successfully installed the Double Tap to Copy for Syntax Highlighter in your blog. If you got any error kindly contact us.

Conclusion

Today we have discussed about How to Add Syntax Highlighter Double Tap to Copy. I hope you find this article very useful. Please like and follow our blog for more post like this daily.

Reference :
Tech With Deo

Getting Info...

About the Author

Hello Friends. Welcome to my website. I hope you all are doing good. If you like our work. Please revisit again. And do like and follow our blogs.

Buy me a Coffee

6 comments

  1. omg, i need it 😍
    1. 😊😊
  2. Yeah very useful code for bloggers.
  3. YOU HAD SUBMITTED YOUR WEBSITE TO https://www.anandnawal.com
    TO ADD YOUR URL,
    AND WE HAVE DONE IT...
    BUT PROBLEM IS YOU DIDN'T ADDED OURS🥺..
    ADD BEFORE 5 DAYS PLEASE OTHERWISE WE WILL REMOVE LINK...
    https://www.anandnawal.com
  4. How to add rate article section bro
    1. Soon there would be a tutorial for it brother.
Please do not spam in the comment section or your comment will not be approved.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.