BREAKING NEWS
བདེ་ཅན་སྨོན་ལམ་བསྡུས་པ།།
Launching a Specific Application without a UAC (User Account Control) Prompt
དུས་དེ་རིང་བཀྲ་ཤིས་ལྷ་རྒྱལ་ལོ།
Hide all the blog posts from the homepage | Hide all the widgets from all the blog posts
CSS for a Trapezoid/Trapezium
CSS for a Rectangle
Full forms of Technical Terms Used in Programming
What is i tag and b tag
CSS For Bold and Italic texts
Write texts on an image in html
Home
Technical Support
Blogger Tutorials
Earn Money
JavaScript
Subscribe Author On YouTube [Click Here>>]
Monday, June 22, 2020
Home
JavaScript
How to show code on blogger with a copy snippet button
How to show code on blogger with a copy snippet button
Sir Chogyal
-
Copy the code below and past inside your html page. You can replace "YOUR CODE GOES HERE" with your code that you wanna show.
<textarea style="border-style: solid; border-width: 1px 1px 1px 20px; border-color: #4072a1; width: 100%; height: 321px; line-height: 16px; resize: none;" id="html1" readonly>YOUR CODE GOES HERE</textarea><div style="font-size:13px; font-family: comic sans ms; color: blue;"><button onclick="copyThis1()">Copy code snippet</button></div> <script> function copyThis1() { var copyText = document.getElementById("html1"); copyText.select(); copyText.setSelectionRange(0, 99999) document.execCommand("copy"); alert("Code snippet copied to clipboard"); } </script>
Copy code snippet
You Might Also Like
How to show code on blogger with a copy snippet button
Jun 22, 2020
-
Sir Chogyal
« PREV
NEXT »
No comments
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments ( Atom )
Subscribe by Email
|
YouTube
|
Facebook
|
Instagram
|
Twitter
Learning JavaScript Quickly
Subscribe by Email
|
YouTube
|
Facebook
|
Instagram
|
Twitter
No comments
Post a Comment