title: Accept/Reject Button in html
body: <p>I am trying to accept or reject invitations through form elements in html.Here is the code :</p>
  
  <pre><code>             &lt;form method="POST"&gt;
               &lt;input type="submit" name="accept" id="accept" value="Accept"&gt;
               &lt;input type="submit" name="decline" id="decline" value="Decline"&gt;
               &lt;/form&gt;  
  </code></pre>
  
  <p>So whenever I try to accept or reject invitations ,the <strong>Accept</strong> or the <strong>Reject</strong> button should change to <strong>Accepted</strong> or <strong>Rejected</strong>.
  I can make that happen using javascript onclick properties.But I am confused on how the response object should handle this in the post route in express js???What should my post route do?
  When I click either accept or reject, the page should not reload and only the clicked button should change..</p>
  
  <pre><code>    response.send()
      response.redirect()
  </code></pre>
  
  <p>My question is what method should my response object contain so that it achieves above(you can think of the 'add to cart' in shopping sites as example). How do I solve it?</p>