- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Disable a dropdown item with Bootstrap
To disable to dropdown item in Bootstrap, use the .disabled class with the .dropdown-menu class.
You can try to run the following code to disable dropdown item −
Example
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <script src = "/scripts/jquery.min.js"></script> <script src = "/bootstrap/js/bootstrap.min.js"></script> </head> <body> <div class = "container"> <h2>Beverages</h2> <p>The following are the beverages available in India:</p> <div class = "dropdown"> <button class = "btn btn-primary dropdown-toggle" type = "button" data-toggle="dropdown">Beverages <span class="caret"></span></button> <ul class = "dropdown-menu"> <li><a href = "#">Gatorade</a></li> <li class = "disabled"><a href = "#">Sting</a></li> <li><a href = "#">Red Bull</a></li> <li><a href = "#">Pepsi</a></li> <li><a href = "#">Coca Cola</a></li> </ul> </div> </div> </body> </html>
- Related Articles
- Disable a list item in a Bootstrap list group
- Disable a button with Bootstrap
- Create Dropdown menu with Bootstrap
- Tabs With Dropdown Bootstrap Example
- Disable a pagination link with Bootstrap
- Align Dropdown to the right with Bootstrap
- Bootstrap dropdown class
- Disable a Bootstrap Button
- Right align a Bootstrap dropdown menu
- Bootstrap class dropdown-header
- Create a caret arrow icon that represents dropdown button with Bootstrap
- Separate links in the dropdown menu with a thin horizontal border with Bootstrap
- How to select an item from a dropdown list using Selenium WebDriver with java?
- How to disable a menu item in JavaFX
- Align a flex item in the center with Bootstrap 4

Advertisements