我有此密码
new ClipboardJS('#copy-btn');
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<button id="copy-btn" class="btn" data-clipboard-target="#table-materials">
Copy to clipboard
</button>
<table id="table-materials" class="table table-sm table-bordered">
<thead>
<tr>
<th><span class="required">Number</span></th>
<th>Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="hidden" data-bind="textInput: id" />
<input type="text" value="John Doe"/>
</td>
<td><input class="form-control form-control-sm" type="text" data-bind="textInput: name" style="min-width:350px;" readonly /></td>
<td><button>Delete</button></td>
</tr>
<tr>
<td>
<input type="hidden" data-bind="textInput: id" />
<input type="text" value="Jane Doe"/>
</td>
<td><input class="form-control form-control-sm" type="text" data-bind="textInput: name" style="min-width:350px;" readonly /></td>
<td><button>Delete</button></td>
</tr>
<tr>
<td colspan="2">Sum</td>
<td><span>13245646</span> kg</td>
</tr>
</tbody>
</table>
此解决方案有两个问题
你怎么看?