我是javascript的新手,我必须要用最多的表来添加和删除按钮在它们之间传输数据,最后我要用提交按钮保存第二个表数据。 谁能帮我这两个表的js吗?
<table id="sugested" class="table table-bordered table-striped table-sm"
>
<thead class="text-right">
<tr id="tr1">
<th data-field="state" data-checkbox="true"></th>
<th data-field="Name" class="text-right">name</th>
<th data-field="SpecialIllId" data-visible="false" class="hidden"></th>
</tr>
</thead>
<tbody class="text-right">
@foreach (var r in Model.sugestedIlls)
{
<tr id="tr3" class="text-right">
<td data-field="state" data-checkbox="true"></td>
<td data-field="Name">@r.Name</td>
<td data-field="SpecialIllId">@r.SpecialIllId</td>
</tr>
}
</tbody>
</table>
<a id="add" class="btn btn-primary "> add </a>
<a id="remove" class="btn btn-primary "> remove </a>
<table id="assigned" class="table table-bordered table-striped table-sm">
<thead class="text-right">
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="Name" class="text-right">name</th>
<th data-field="SpecialIllId" data-visible="false" class="hidden"></th>
</tr>
</thead>
<tbody class="text-right">
@foreach (var r in Model.asighnedIlls)
{
<tr id="tr2">
<td data-field="state" data-checkbox="true"></td>
<td data-field="Name">@r.Name</td>
<td data-field="SpecialIllId">@r.SpecialIllId</td>
</tr>
}
</tbody>
</table>