I tried to copy the ag grid table to clipboard using class name when click on button but it was not working.
copyTable() {
var tblDat= document.getElementsByClassName('tableStats');
tblDat.select();
document.execCommand('copy');
}