title: How to disable/enable a column based on value inserted in other column of a table through Jquery
body: <p>I have a table having multiple columns and rows can be added by supplying no. of emp by the user. </p>
  
  <p>Now I want to disable a particular field based on user choice for emp_type field.
  For example if user selects <strong>Permanent ** then hours field for that particular row should disable and if user selects **Contract</strong> days field for that row should disable.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>&lt;HTML&gt;
  &lt;Body&gt;
  &lt;head&gt;
   &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
   &lt;head&gt;
   &lt;TABLE id="EMPTable" width="350px" border="1"&gt;
      &lt;tr&gt;
          &lt;th&gt;ID&lt;/th&gt;
          &lt;th&gt;Name&lt;/th&gt;
          &lt;th&gt;Emp_Type&lt;/th&gt;
          &lt;th&gt;Hours&lt;/th&gt;
          &lt;th&gt;Days&lt;/th&gt;
      &lt;/tr&gt;
      &lt;TR&gt;
          &lt;td&gt;&lt;input type= "text" id = "Id1" name= "Id[]" value="1"  /&gt; &lt;/td&gt;
          &lt;td&gt;&lt;input type= "text" id="Name1" name= "Name[]" &gt;&lt;/td&gt;
          &lt;td&gt;&lt;select name="Emp_Type[]" id ="Emp_Type1"onchange="codename()" &gt; 
              &lt;option value=""&gt;Emp Type&lt;/option&gt;
              &lt;option value="Per"&gt;Permanent&lt;/option&gt;
              &lt;option value="Con"&gt;Contract&lt;/option&gt;
              &lt;/select&gt;
          &lt;/td&gt;
          &lt;td&gt;&lt;input type= "text" id="Hours1" name= "Hours[]" &gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type= "text" id="Days1"name= "Days[]" &gt;&lt;/td&gt; 
      &lt;TR&gt;
      &lt;/TABLE&gt;    
       &lt;/BR&gt;
      &lt;label&gt;No. of EMP &lt;input type= "text" id="emp_cnt" name= "EMP_Count"&gt;&lt;/label&gt;
       &lt;button type="button" class='loadtable' &gt; Load table&lt;/button&gt;
       &lt;script&gt; 
        $(".loadtable").on('click',function(){
              var num = $("#emp_cnt").val();
              $("#EMPTable tr").slice(2).remove();
              for (var i = 2; i &lt;= num; i++) 
              {
                  var data = "&lt;tr&gt;&lt;td&gt;&lt;input type='text' id='Id"+i+"' name='Id[]' value = "+i+" /&gt;&lt;td&gt;&lt;input type='text' id='Name"+i+"' name='Name[]' /&gt;&lt;/td&gt;&lt;td&gt;&lt;select id='Emp_Type"+i+"' name='Emp_Type[]'&gt;&lt;option value='null'&gt;Emp Type&lt;/option&gt;&lt;option value='Per'&gt;Permanent&lt;/option&gt;&lt;option value='Con'&gt;Contract&lt;/option&gt;&lt;/td&gt;&lt;td&gt;&lt;input type='text' id='Hours"+i+"' name='Hours[]'/&gt;&lt;/td&gt;&lt;td&gt;&lt;input type='text' id='Days"+i+"' name='Days[]'/&gt;&lt;/td&gt;&lt;/tr&gt;";
                  $("#EMPTable").append(data);
              }
      });  
  &lt;/script&gt; 
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>Can Someone please guide how to disable a column of a table based on other column selection, where the rows are not fixed for table.</p>