title: Change button value after clicking on it
body: <p><a href="https://i.stack.imgur.com/QJALK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QJALK.png" alt="enter image description here"></a></p>
  
  <p>I have a function which returns bootstrap row and every row contains input field, textarea and remove button. </p>
  
  <p>So I have multiple bootstrap rows as I am calling function for various time. After clicking on remove button I am changing border color of input and textarea just to indicate that I am not taking it into consideration. I have made remove button to work as toggle button so that it will add and remove error class that I am assigning to input and textarea. </p>
  
  <p>Now I want to change the value of 'Remove' button to 'Add'. So that when I click on 'Add' button it will remove the style of input and textarea and it means that I can take those values into consideration.</p>
  
  <pre><code>function GetDynamicTextBox(value, tag) {
  return'&lt;div class="col-lg-4"&gt;&lt;input class="form-control" type="text" value="'+tag+'" name="typetag" id="tags" data-role="tagsinput"/&gt;&lt;/div&gt;'+'' +
      '&lt;div class="col-lg-6"&gt;&lt;textarea class="form-control issuetext" name="comment" id="" cols="" rows=""&gt;'+value+'&lt;/textarea&gt;&lt;/div&gt;'+
      '&lt;div class="col-lg-2"&gt;'+
         '&lt;input type="button" value="Remove" class="remove btn btn-default" /&gt;&lt;/div&gt;'
  }
  
   $("body").on("click", ".remove", function () {
      $(this).closest('#issue').find('.bootstrap-tagsinput').toggleClass('error')
      $(this).closest('#issue').find('.issuetext').toggleClass('error')
  
  
  });
  
  
  
  &lt;div class='row'id="issue"&gt;
     &lt;div class="col-lg-4"&gt;
       &lt;input class="form-control" type="text" value="'+tag+'" name="typetag" 
       id="tags" data-role="tagsinput"/&gt;&lt;/div&gt;
    &lt;div class="col-lg-6"&gt;
      &lt;textarea class="form-control issuetext" name="comment" id="" cols="" 
      rows=""&gt;'+value+'&lt;/textarea&gt;&lt;/div&gt;
    &lt;div class="col-lg-2"&gt;
      &lt;input type="button" value="Remove" class="remove btn btn-default" /&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>