title: How can i Hide and Show Submit button when one is button is clicked
body: <p>i am retrieving some data from database and show them in a html table.but right now i am struggling with the following scenario.</p>
  
  <p>if user clicks disable button it should be hide and enable button should be show.if user clicks on enable button it should be hide and disable button should be show.</p>
  
  <p>Here is my code</p>
  
  <pre><code>&lt;html&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;head&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="jquery-1.4.2.min.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
  
          $('input:submit').click(function(){
              $('input:submit').attr("disabled", true);
          });
      &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;?php
  
  echo "&lt;table border='1' align='center' width='100%'&gt;
  &lt;tr&gt;
  &lt;th&gt;ID&lt;/th&gt;
  &lt;th&gt;Image&lt;/th&gt;
  &lt;th&gt;Modified Date&lt;/th&gt;
  &lt;th&gt;URL&lt;/th&gt;
  &lt;th&gt;Clicks&lt;/th&gt;
  &lt;th&gt;Status&lt;/th&gt;
  &lt;th&gt;Action&lt;/th&gt;
  &lt;/tr&gt;";
  
  while($row = mysqli_fetch_array($query))
  {
      $id = $row['img_id'];
  
      echo "&lt;tr&gt;";
      echo "&lt;td align='center'&gt;" . $row['img_id'] . "&lt;/td&gt;";
      echo "&lt;td align='center' width='500px'&gt;" . '&lt;img width = 200px; height=100px; src=" '. ($row['img_path']) . '"/&gt;'. "&lt;/td&gt;";
      echo "&lt;td align='center' width='350px'&gt;" . $row['date'] . "&lt;/td&gt;";
      echo "&lt;td align='center'&gt;" . $row['url'] . "&lt;/td&gt;";
      echo "&lt;td align='center'&gt;" . $row['clicks'] . "&lt;/td&gt;";
      echo "&lt;td align='center'&gt;" . $row['status'] . "&lt;/td&gt;";
      echo "&lt;td align='center'&gt;&lt;a href='image_update.php?id=$id'&gt;&lt;button&gt;Update&lt;/button&gt;&lt;/a&gt;
  
      &lt;form method='post' &gt;
  
          &lt;input type='hidden' name='tid' value='$id'/&gt;
          &lt;input type='submit' name='disable' id='disable' value='Disable'&gt;
           &lt;input type='submit' name='enable' id='enable' value='Enable'&gt;
      &lt;/form&gt;
  
      &lt;/td&gt;";
  
      $id = $_POST['tid'];
      if($_SERVER['REQUEST_METHOD']=='POST') {
  
  
          $sql = "UPDATE advertisementnew SET status = 'Disabled' WHERE img_id='$id'";
          mysqli_query($con, $sql);
      }
  
      echo "&lt;/tr&gt;";
  
  }
  
  
  echo "&lt;/table&gt;";
  </code></pre>