I have four HTML files and inside of them have multiple tables
<table>
.
I'm trying to put at the end of each of these files a code to just copy the tables, so that later I can paste in excel and go organizing. I am not able to copy it by tag.
I want to make a fifth file, which copies all the tables to paste into excel.
<button onclick="copy()">Copiar</button><br>
<script type="text/javascript">
function copy(){
var text = document.getElementsByTagName("table");
var range = document.createRange();
range.selectNode(table);
window.getSelection().addRange(range);
document.execCommand('copy');
}
</script>