how to select a pre-defined value in bootstrap 3 dropdown -


I have the following fiddle, it all looks fine, but the point is that instead of initially selecting 'I' The first option was to put in the selected dropdown. How can I go about doing this?

  & lt; Div class = "input-group-btn" & gt; & Lt; Button type = "button" class = "BTN BTN-default dropdown-toggle" data-toggle = "dropdown" & gt; Yellow Janis Search & lt; Span class = "carat"> gt; & Lt; / Span & gt; & Lt; / Button & gt; & Lt; Ul class = "pull-down menu pull-right" & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; By clicking & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Toko & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt;   

It looks like what happens when you select a value from the dropdown, it only goes to the link given in href, instead of what I want, The behavior of being the same is the same. But the interface is just like I have.

This feature is Menu . It can be considered similar to the stack overflow menu.

dropdown example

I understand that you have another traditional Want to

choose example

The Bootstrap dropdown is actually a selection Replacing is not considered a dropdown behavior would require some javascript functionality to be preferred (or similar would be a good option).

Bootstrap comes with one, but it does not fancy anything.

HTML
  & lt; Div class = "container" ng-controller = "search controller" & gt; & Lt; Div class = "input-group" & gt; & Lt; Input id = "search box" type = "text" class = "form-control search-query" placeholder = "mosaicane producer yo kamu divi divini" & gt; & Lt; Div class = "input-group-btn" & gt; & Lt; Button type = "button" class = "BTN BTN-default dropdown-toggle" data-toggle = "dropdown" & gt; {{Received ()}} & lt; Span class = "caret" & gt; & Lt; / Span & gt; & Lt; / Button & gt; & Lt; Ul class = "dropdown menu" & gt; 
  • gtc: / li> & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;

    javascript
      var app = angular Module ("app", []); Var searchController = app.controller ("searchController", function ($ scope) {$ scope.options = ["Baranga", "Toko"]; $ scope.selected = "Search Janice Search"; $ scope.selectOption = function Option) {$ scope.selected = $ scope.options [options];} $ scope.getSelected = function () {return scope.selected;}});    

  • Comments

    Popular posts from this blog

    c - Mpirun hangs when mpi send and recieve is put in a loop -

    python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

    java - Unable to get JDBC connection in Spring application to MySQL -