How to make Parent Menu Items Clickable in Bootstrap 3

Check out my other posts and tutorials on Web Development!

By default, clicking a Bootstrap parent menu link only produces it’s dropdown menu without following that link. Adding this jQuery snippet will make your parent menu items clickable again!

$('.dropdown-toggle').click(function() {
    var location = $(this).attr('href');
    window.location.href = location;
    return false;
});

You can test this functionality in the navigation above!

10 Responses to How to make Parent Menu Items Clickable in Bootstrap 3

    • Hi mauricio,

      This would imply that your parent menu items don’t actually link anywhere. If that is the case, then you really don’t need this code snippet.

      If you are only trying to target certain parent menu links, try adding a class to those links and targeting via jQuery (instead of using .dropdown-toggle).

      Hope that helps!

      Reply

Leave a Reply

Contact Us

Subscribe

Subscribe to our blog to receive latest news and tutorials on Web Design, Development, SEO, and more!