Hi there,
i know how to create a Dropdown (Select) based on Enum inside my Model. But how can i create such a Dropdown in dynamically created HTML code within Javascript because i can not directly access the .Net Core Model stuff.
So this is my Javascript part:
$("#ELEMENT").click( function(){$('#SUB-ELEMENT').append("<div class='col-md-4'>" +"<select class='form-control' id='experience'>" +"<option value='0' selected>Basic</option>" +"<option value='1'>Extended</option>" +"<option value='2'>Professional</option>" +"<option value='3'>Master</option>" +"<option value='4'>Junior</option>" +"</select>" +"</div>" ); });
So there the <select> part sould be replaced by something like this, which i use in normale razor code view:
<select asp-for="Model.XXX" asp-items="Html.GetEnumSelectList<Flexibility>()" class="form-control"></select>
How can i do this? Thanks!