Sunday, November 17, 2019

Copy text to clipboard by jQuery


<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:.

Switch PHP version in Ubuntu OS or Zorin OS

First check where is installed your PHP by the below command: $ which php See PHP version by below command: $ php -v As I've installed P...