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

后端 未结 4 1657
暗喜
暗喜 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条回答
  •  误落风尘
    2021-02-05 16:52

    you can try this:

    u can use class or id for selector to select easier the element. for use the value also u can use the value in u javascript with jQuery.

        $().ready(function(){
            $('a').click(function(){
                var value = $(this).text();
                alert(value);
            });
        });
    

    Demo: http://jsfiddle.net/mr_mohsen_rasouli/A8m39/

提交回复
热议问题