how to set bootstrap button to active on click using javascript -


  <div class="row">       <div class="col-md-8">     <h3 >          <button  type=submit class="btn btn-primary btn-lg btn-block" .button><a href = "mrequest.php">make request</button> </h3>     </div>     </div>         <div class="row">       <div class="col-md-8"> <h3>           <button type=submit class="btn btn-primary btn-lg btn-block" .button><a href = "mviewreq.php">view requests</button>    </h3>     </div>     </div>     <div class="row">      <div class="col-md-8">  <h3>          <button type=submit class="btn btn-primary btn-active btn-lg btn-block" .button><a href = "mviewstaff.php">quotation requests</button> </h3>     </div> 

how can change button active when particular button clicked , , want use same thing on navigation tabs too. , make active too, please can post jquery or thing can use it. have searched on internet unable understand

add bootstrap active class using jquery

<button id="btn1" type=submit class="btn btn-primary btn-lg btn-block" .button>   $('#btn1').on('click', function (e) {             $('#btn1').each(function () {                 $(this).addclass('active');             })          }); 

this works navigation , if replace elementid li.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -