How to change the main display of dropdown when an item is selected in bootstrap

后端 未结 3 2015
你的背包
你的背包 2020-12-21 02:03

This is the following http://jsfiddle.net/coderslay/enzDx/

I am trying to change the text Select as soon as an item is clicked

So if i selec

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-21 02:18

    HTML:

    
    

    JavaScript:

    $('.dropdown-toggle').dropdown();
    $('#divNewNotifications li > a').click(function(){
        $('#text').text($(this).html());
    });
    

    DEMO

    I have just added a span around the Select text in html to do the Javascript code simpler.

提交回复
热议问题