On click of a button, the jquery gets the id of the button which is clicked. I want to copy the same id in clipboard to paste it somewhere. Here is the code:
$("#datatable-buttons").on("click",":button",function(e){
var id = $(this).attr('id');
Now I need the variable id to be copied to clipboard. How to do that?