Aug 2, 2016

Make Blockquote Code Auto Select by Single/Double Click in Blogger

data:blog.title
make auto select blockquote in blogger
If you are trying to make your blockquote auto select when someone click/double click on it and wondering how to make it possible then you are on right platform because today in this article we are going to share another blogger trick with all of you by which yo can help your readers to easily copy your codes from blockquote section.

How To Make Auto Select Blockquote Code by Single/Double Click in Blogger

Recommended - How To Make Blockquote Scrollable in Blogger?

You definitely know what is blockquote tag, We use different stylish blockquote in our site but often user has to select the whole code block top to bottom for copying. If the code is larger, then it will make little trouble for user. Because by using cursor sometimes mouse pointer become deselected. Many of us use the blockquote tag to write code. But not everyone use the blockquote tag to write code there are some people who are using pre tag so this trick also work for pre tag and they also face this problem. So the solution is to one click text selection from blockquote by using mouse pointer. After that we have to use copy option for further use of code.

Recommended Blogger Tricks & Plugins

  1. 25+ Styles to Customize/Change Blockquote Style in Blogger.
  2. Disable Copy Function in Blogger Page instead Blockquote.
  3. Add Scrollbar Percentage Value Function to Blogger.
  4. Stylish Contact Form For Blogger! Never Seen Before.
  5. Cute & Stylish Popup Subscription Box for Blogger.

This trick is too much viral now a days. There are many professional bloggers who are using this trick included me. For the live demo you can click on this post's blockquote area where we add code. Just double click on it and the whole code will be select instantly. This trick is very useful for our readers to make him feel comfortable on our site. To use this function on your blogger blog follow below instruction carefully.

How To Make Blockquote Code Auto Select in Blogger

  • Go to Blogger >> Template >> Edit HTML.
  • Now search </body> tag by pressing CTRL+F or CMD+F inside your blogger template and paste below code just above of </body> tag.
<script type='text/javascript'>
var pres = document.getElementsByTagName(&quot;blockquote&quot;);
for (var i = 0; i &lt; pres.length; i++) {
pres[i].addEventListener(&quot;dblclick&quot;, function () {
var selection = getSelection();
var range = document.createRange();
range.selectNodeContents(this);
selection.removeAllRanges();
selection.addRange(range);
}, false);
}
</script>

Customization:

  1. If you are using pre code instead of blockquote then replace blockquote with pre.
  2. If you want single click to select text then replace dblclick to click.
  •  Now, Simply hit on Save Template.
  • That's it. You have done it successfully.
  • Now open your blog and watch this feature on your blogger blog.

Conclusion:

So above guide is aboout How To Make Blockquote Code Auto Select by Single/Double Click in Blogger? We hope this tutorial helps you in installing this feature on your blogger blog. If anyhow problem persist after following all steps then ask us via dropping a comment below. We will help you out of sure. Do Share.
Thank You! Stay Blessed!

No comments:

Post a Comment

We’re eager to see your comment. If you have any query related to the topic then drop a comment below. We will help you out of sure. However, Please Keep in mind that all comments are moderated manually by our human reviewers. According to our comment policy all link are nofollow so keep in mind that never use links in comments, we consider link comments as a spam.