<td>
@Html.Label(item.NAME, new { id = @item.SUPERID + "Name" })
</td>
<td>
@Html.EditorFor(modelItem => item.NAMEA, new { htmlAttributes
= new { @class = "form-control", id = @item.SUPERID + "Namea"
} })
</td>
<td>
<button Type="button" class="btn btn-primary pull-right"
id="COPY" OnClick=button_onclick("@item.SUPERID") >Copy From
SAP <span class="fa fa-copy"></span></button>
</td>
@section scripts
{
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js">
</script>
<script>
$('#xyz').DataTable({
"bFilter": false,
"bLengthchange":false
});
function button_onclick(ID) {
$("#ID +Namea").val()= $("#ID +Name").val();
alert();
}
</script>
}
这是我编写的代码。 在这里,我试图将label中的值分配给html“ editorfor”元素的值。下面有人可以帮助我吗?