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.
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.
[alert headline="Alert!"]Backup your blogger template first.[/alert]

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.
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
</body>
- paste below code just above of </body> tag.
<script type='text/javascript'>
var pres = document.getElementsByTagName("blockquote");
for (var i = 0; i < pres.length; i++) {
pres[i].addEventListener("dblclick", function () {
var selection = getSelection();
var range = document.createRange();
range.selectNodeContents(this);
selection.removeAllRanges();
selection.addRange(range);
}, false);
}
</script>
Customization:
- If you are using pre code instead of blockquote then replace blockquote with pre.
- If you want single click to select text then replace dblclick to click.
[success headline="Success"]That's it. You have done it successfully.[/success]
Now open your blog and watch this feature on your blogger blog.
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!
Now open your blog and watch this feature on your blogger blog.
Conclusion:
Thank You! Stay Blessed!
COMMENTS