Twitter Bootstrap inline input with dropdown

后端 未结 6 1216
-上瘾入骨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:08

    This is the code for Bootstrap with input search dropdown. I search a lot then i try its in javascript and html with bootstrap,

    HTML Code :

    Javascript Code :

    function doOn(obj)
         {
    
            if(obj.id=="mydef")
            {
                document.getElementById("def1").style.display="none";
                document.getElementById("def").style.display="block";
            }
            if(obj.id=="search")
            {
                document.getElementById("def").style.display="none";
    
                document.getElementById("def1").innerHTML='
  • java
  • Oracle
  • '; document.getElementById("def1").style.display="block"; } } function mydef(obj) { document.getElementById("search").value=obj.innerHTML; document.getElementById("def1").style.display="none"; document.getElementById("def").style.display="none"; }

    You can use jquery and json code also as per your requirement.

    Output like:

提交回复
热议问题