box with copy button
Text area code
<br><br> <textarea style="border-style: solid; border-width: 1px 1px 1px 20px; border-color: #4072a1; width: 100%; height: 300px; line-height: 16px; resize: none;" id="html1" readonly> </textarea><div style="font-size:13px; font-family: comic sans ms; color: blue;"><button onclick="copyThis1()">Copy This Code </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> <br><br>
Online Syntax highlighting tool
https://tohtml.com/
Comments
Post a Comment