0
  <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 a 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 I change the button to active when some particular button is clicked , and i also want to use same thing on the navigation tabs too. and make it active too, please can some post any jquery or some thing like that so I can use it. I have searched on internet about it but i am unable to understand it

1 Answer 1

2

Add a 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 well with the navigation , if you replace the ElementId with li.

Sign up to request clarification or add additional context in comments.

2 Comments

ElementId id is a build-in function of jquery ?? or i have to give the reference of Element id in my button ?
you have to give an id to the button, i will edit the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.