I have a button then when clicked creates a table row with a select element inside of it. I want to insert a tag helper dynamically using javascript. Is there a way to insert a TagHelper via javascript or am I just going to have to do it the long way and build out the select?
function createNewRow() {
var row = `<tr>
<td><select></select></td>
<td class="rowControl"><input id="setLeadCheckbox" type="checkbox" /></td>
<td class="trash-cell"><i class="fa-regular fa-trash-can fa-2x"></i></td>
</tr>`;
$('#staffTable').append(row);
}
I instead want to use the built in .NET Core Select Tag Helper
<select asp-for="SelectedEmployeeId" asp-items="Model.Employees"></select>