function copy(){
var tb = document.getElementById("table");
var tr = document.querySelectorAll("-sharptable tr:last-of-type td").value;
alert(tr);
var copyalbe = tr;
var input = document.createElement("input");
input.value = copyalbe;
document.body.appendChild(input);
input.select();
document.execCommand("copy");
input.style.display = "none";
alert("");
}
<table id="table" width="200" border="1" cellspacing="0">
<tr id="cow1">
<td>123</td>
<td>111</td>
</tr>
<tr id="cow2">
<td>123</td>
<td>111</td>
</tr>
<tr id="cow3">
<td class="copyalbe">123</td>
<td class="copyalbe">111</td>
</tr>
</table>
<input id="btn" type="button" value="" onclick="copy()">
I want to get the value of two td in the last tr in table and copy it, but I don"t know how to get the value. Do you have any advice from an old friend?