Twitter Bootstrap: How do I get the selected value of dropdown?

后端 未结 4 1659
暗喜
暗喜 2021-02-05 16:33

I need to get the value a user selects from a twitter bootstrap dropdown. Once the user selects a value I want the dropdown to display that value. So, the user selects \'pending

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 16:53

    Try like this -

    $(document.body).on('click', '.dropdown-menu li a', function (e) {
        alert($(this).text());
    });
    

    Demo - Fiddle

提交回复
热议问题