How to add copy text or code box in blogger

Add copy text or code box




If you write a blog, it happens many times that you want to put some post or code in the box so that users can copy and use them. Adding copy box blogger for this is very easy. Just you have to put your code or text in the middle of a code and then you can copy and use it from the user.





Step 1-


First of all, you should type your post text or code in notepad or in any other software.


Step 2-


Now you have to copy the code given below and paste it in any notepad or any other software which you use.


<br><textarea rows="5" cols="60" readonly id="Inputtxt">everyday41.com</textarea>
    </br>
    <button onclick="myFunction()">Copy</button>
<script type="text/javascript">

            function myFunction() {
            var copyTxt = document.getElementById("Inputtxt");
            copyTxt.select();
            document.execCommand("copy");
            }
</script><br>






Step 3-


When you have to make some changes in school, copy whatever text or code you want to put inside the box. And paste it in place of "everyday41.com". Which I have highlighted in yellow.


<br><textarea rows="5" cols="60" readonly id="Inputtxt">everyday41.com</textarea>
    </br>
    <button onclick="myFunction()">Copy</button>
<script type="text/javascript">

            function myFunction() {
            var copyTxt = document.getElementById("Inputtxt");
            copyTxt.select();
            document.execCommand("copy");
            }
</script><br>


Step 4-


Now wherever you want to create the box in your post. You can shift your post from compose to HTML. And wherever you want to create the box. At that place, you paste that code.  Which you have prepared till step 3 in notepad or any other software.  And when you set your post back to compose, a box like this will appear as seen below.









And you can also make this box small or big according to your content or post.

Post a Comment

0 Comments