title: How To Enable/Disable a Table Row in jQuery
body: <p>Is there a pre made function in jQuery wherein when you click a button it will enable a row. Then if you click it again, it will disable the row. I found about toggle() and toggleClass(). But it does work when it calls a function. The thought is somewhat like this but I know the syntax is wrong.</p>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>function disableRows(){
  $("#test1table tbody tr").each(function() {
      $(this).find('input:text').prop('disabled', true);
  });
  
  function enableRows(){
  $("#test1table tbody tr").each(function() {
      $(this).find('input:text').prop('disabled', false);
  });
  
  $(document).ready(function() {
    $('.yearButt').click(function(){
        $(this).toggleClass(enableRows(), disableRows());
    });
  }); 
  </code></pre>