Disable Dropdown Button in Bootstrap
home
Run
screen_rotation
fullscreen
cloud_download
<html> <head> <title>Bootstrap Grid</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- Latest compiled and minified JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> <script type="text/javascript"> function disableDropdown(){ $("#myDropdown").addClass('disabled'); } function enableDropdown(){ $("#myDropdown").removeClass('disabled'); } </script> </head> <body> <div class="container" style="padding:50px;"> <div class="dropdown"> <button id="myDropdown" class="btn btn-primary dropdown-toggle " type="button" data-toggle="dropdown">Dropdown Demo Example <span class="caret"></span></button> <ul class="dropdown-menu"> <li><a href="#">Home</a></li> <li><a href="#">Settings</a></li> <li><a href="#">Logout</a></li> </ul> </div> <a href="javascript:void(0)" onclick='disableDropdown();'>Disable Dropdown</a><br> <a href="javascript:void(0)" onclick='enableDropdown();'>Enable Dropdown</a> </div> </body> </html>
<html> <head> <title>Bootstrap Grid</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- Latest compiled and minified JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> <script type="text/javascript"> function disableDropdown(){ $("#myDropdown").addClass('disabled'); } function enableDropdown(){ $("#myDropdown").removeClass('disabled'); } </script> </head> <body> <div class="container" style="padding:50px;"> <div class="dropdown"> <button id="myDropdown" class="btn btn-primary dropdown-toggle " type="button" data-toggle="dropdown">Dropdown Demo Example <span class="caret"></span></button> <ul class="dropdown-menu"> <li><a href="#">Home</a></li> <li><a href="#">Settings</a></li> <li><a href="#">Logout</a></li> </ul> </div> <a href="javascript:void(0)" onclick='disableDropdown();'>Disable Dropdown</a><br> <a href="javascript:void(0)" onclick='enableDropdown();'>Enable Dropdown</a> </div> </body> </html>
Copyrights@tutorialsplane.com