Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

handling dropdown item selected event using Bootstrap

Hi I have just started using twitter bootstrap and trying my hand on handling dropdown events.

I want to handle the dropdown item selected event, that is, when the user clicks on a particular item, a table should be displayed just below the dropdown. Can anyone please help me out in achieving this? Thank you.

<ul class="dropdown-menu">
    <!-- dropdown menu links -->
    <li><a href="#" id="action-1">How are you?</a></li>
    <li><a href="#2">What is your name</a></li>
    <li><a href="#section-2">Section 2</a></li>
</ul>
like image 500
user2782692 Avatar asked Sep 16 '13 06:09

user2782692


1 Answers

There's no such event in Bootstrap, the only events you can handle for dropdowns are show, shown, hide, hidden, you can use simple jQuery for this though:

$('.dropdown-menu a').click(function(){
    //Show table
});
like image 81
omma2289 Avatar answered Sep 21 '22 05:09

omma2289