Twitter Bootstrap inline input with dropdown

后端 未结 6 1226
-上瘾入骨i
-上瘾入骨i 2020-12-12 23:26

I\'m trying to display a text input inline with a dropdown button. I can\'t figure out how to do this though. Here\'s the HTML I\'ve tried (I\'ve put all of it on a single

6条回答
  •  悲哀的现实
    2020-12-13 00:10

    Daniel Farrell's Bootstrap Combobox does the job perfectly. Here's an example from his GitHub repository.

    $(document).ready(function(){
      $('.combobox').combobox();
      
      // bonus: add a placeholder
      $('.combobox').attr('placeholder', 'For example, start typing "Pennsylvania"');
    });
    
    
    
    
    
    

    As an added bonus, I've included a placeholder in script since applying it to the markup does not hold.

提交回复
热议问题