How to use Bootstrap Button Plugins


Add in some interaction such as control button states or create groups of buttons for more components like toolbars with the plugin.

You can try to run the following code to implement button plugin −

Example

Live Demo

<!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>
      <h4>Button Example</h4>
      <div id = "myButtons2" class = "bs-example">
         <button type = "button" class = "btn btn-primary" data-loading-text = "Loading...">
            Primary
         </button>
      </div>
      <script type = "text/javascript">
         $(function () {
            $("#myButtons1 .btn").click(function(){
               $(this).button('toggle');
            });
         });
      </script>
   </body>
</html>

Updated on: 15-Jun-2020

68 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements