I have a select dropdown menu containing a list of states. I have restricted the visible options after clicking the dropdown via this stackoverflow solution as can be seen in my code below:
<div>
<label asp-for="Venture.Location" class="form-label">Venture Location</label>
<select asp-for="Venture.Location" class="form-input form-select" required onmousedown="this.size=9" onblur="this.size=0" onchange="this.size=0">
<option disabled selected value="">select an option</option>
@foreach(var location in Model.Locations)
{
<option value="location">@location</option>
}
</select>
</div>
However, clicking the dropdown, I will see a cuttoff option thus showing more than 9 options. How can I make sure to only show the correct amount of options via the size? How can I get rid of the cutoff option?