Search code examples
htmlcsslistdropdowndirection

How to prevent drop down list goes upwards?


I want to my drop-down list only goes downwards not in both direction

Image

<select name="routeNo">
<option value="" disabled selected style="color: rgb(214, 205, 205);">Bus No.</option>
<%**strong text**
while(rs.next())
{%>
    <option><%=rs.getString("routeNo")%></option>
<%}
%>

Check my repository


Solution

  • "Drop-downs are rendered by the Browser/OS. You cannot control this type of behaviour using CSS or JavaScript."

    ~Diodeus - James MacFarlane

    Refer to: How do you stop a dropdown menu from going up?