Q:

Disable a button for a particular tab

I have two tabs:-
<div class="modal-body">
   <form name="myForm" novalidate="novalidate">
    <ul class="nav nav-tabs">
       <li class="active"><a data-toggle="tab" href="#basicInfo">Info</a></li>
       <li><a data-toggle="tab" href="#view">View Details</a></li>
    </ul>

  <div class="tab-content">
     <div id="basicInfo"  class="tab-pane fade in active modal-table-div">
      .....
     </div>
  <div id="view" class="tab-pane modal-table-div fade">
     .....
     </div>
</div>

And a Delete and Add button button: 
<div class="modal-footer">
     <button type="button" class="btn btn-danger">Delete</button>
     <button type="button" class="btn btn-success">Add</button>
</div>

What I want is when I click on the 'view details' tab the delete button and add button got disabled and viceversa.How should I achieve that?

A:

I would add a class diableButton to the link that shall trigger the disable function, use the code below.
This line $(this).find("a").hasClass("diableButton") will then ask if our link has the class. 

$('.nav-tabs li').click(function() {
  if ($(this).find("a").hasClass("diableButton")) {
    $('.modal-footer button').prop("disabled", true);
  } else {
    $('.modal-footer button').prop("disabled", false);
  }
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="modal-body">
  <form name="myForm" novalidate="novalidate">
    <ul class="nav nav-tabs">
      <li class="active"><a data-toggle="tab" href="#basicInfo">Info</a></li>
      <li><a data-toggle="tab" class="diableButton" href="#view">View Details</a></li>
    </ul>

    <div class="tab-content">
      <div id="basicInfo" class="tab-pane fade in active modal-table-div">
        .....
      </div>
      <div id="view" class="tab-pane modal-table-div fade">
        .....
      </div>
    </div>

    <div class="modal-footer">
      <button type="button" class="btn btn-danger">Delete</button>
      <button type="button" class="btn btn-success">Add</button>
    </div>

