I am trying to make copy to clipboard. It's working on div element but if i use it in datatable that time not working
here is my code
->editColumn('value', function ($data) {
return '<span>'.$data->value.'</span> <i class="fa fa-copy" title="Copy to Clipboard" data-toggle="tooltip" onclick="copyToClipboard(this,'.$data->value.')"></i>';
})
function copyToClipboard(em,text) {
var dummy = document.createElement("textarea");
dummy.style.display = 'none'
document.body.appendChild(dummy);
dummy.value = text;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
$(em).attr('data-original-title', 'Copied')
.tooltip('fixTitle')
.tooltip('show');
}
it shows Uncaught SyntaxError: missing ) after argument list . How can i fix ?