I have a drop down and a list group box. on the drop down change event I need to remove all the items and add new items.
Below is the list group box
<select style="max-height: 30vh; min-height: 30vh; width: 100%; border: 0;"
multiple="multiple"
class="list-group list-group-available-items overflow-auto">
@foreach (var listGroupOption in Model.OrderItems ?? new List<SelectListItem>())
{
<option value="@listGroupOption.Value" class="list-group-item">
@listGroupOption.Text
</option>
}
</select>
This is my try at JavaScript
$('#ddlRegion').change(function (e) {
$(".list - group - available - items")
.find('option')
.remove();
});