HTML Select and Text Input

后端 未结 3 1160
萌比男神i
萌比男神i 2021-01-15 14:28

We have all seen countless instances of forms with a select drop down having one of it\'s options as \"Other\" and on choosing that option, we get to see a input text box (w

3条回答
  •  醉话见心
    2021-01-15 15:24

    You could use datalist. Example:

    
    
    
        
    

    Fiddle: http://jsfiddle.net/joshpauljohnson/Uv5Wk/

    This gives the user the ability to select from a list of cookies and, if the type of cookie they seek is not found in the list, enter their own.

    My only beef with it in your situation is that it may not be immediately obvious to the user they can use it as a drop down. But that could be easily remedied with a little bit of css.

提交回复
热议问题