<button class="btn btn-primary copy-full-code">Copy to clipboard</button>
<script>
jQuery('.copy-full-code').click(function(){
/* Get the text field */
var copyText = jQuery("#fcode").text();
var dummy = document.createElement("textarea");
document.body.appendChild(dummy);
dummy.value = copyText;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
});
</script>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>Paste your text here.
</code></pre>
.:Happy Coding:.
No comments:
Post a Comment