copy to Clipboard

function copyToClipboard(element) {
var $temp = $("<input>");
$("body").append($temp);
$temp.val($(element).text()).select();
document.execCommand("copy");
$temp.remove();
}
$(function() {
   $('.allowCopy').click(function() {
     $(this).focus();
     $(this).select();
     document.execCommand('copy');
   });
});
The above jQuery code will allow click events for all HTML controls with a CSS class “allowCopy” and then select the text and execute document.execCommand(‘copy’); command which will copy the data. Below is HTML code:


<input readonly type="text" value="Click Me To Copy" class="allowCopy noselect">
Here is the jQuery code to disable right click on your website:

$(function(){
   $(document).on("contextmenu",function(e){
      e.preventDefault();
   });
});

css

.noselect { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }