Update span content with php response on submit

Update span content with php response on submit

Hi,

I am really new with jQuery, I read a lot of tutorials and documentation, but still I don't get it 

I have a simple HTML table:

Product Quantity Location Action
2TB SATA Western Digital 32 IS102
480GB SSD Samsung 19 IS020
16GB 10600R 12 IS100
8GB 8500U 3 ISO100
32GB 8500U 21 ISO100
4GB 8500U 4 ISO100

When an amount is filled in in the text field and the button Sell is clicked, I want that the following happens:
- updateAmount.php must be run, it will or return the text error or it will return "success" + new amount.
- When it returns the text "error", that text must be shown in <span id="status"></span> and fade out after 2 seconds.
- When it returns the text "success", that text must be shown again in <span id="status"></span> and fade out after 2 seconds, BUT, it must also update the quantity with the new amount.

Anyone can redirect me in the right direction?

This is my HTML code:
  1.     <div class="row large-centered">
  2.         <input type="text" id="search" placeholder="Type to search..." />
  3.         <table id="table" width="800px">
  4.             <thead>
  5.                 <tr>
  6.                     <th>Product</th>
  7.                     <th>Quantity</th>
  8.                     <th>Location</th>
  9.                     <th>Action</th>
  10.                 </tr>
  11.             </thead>
  12.             <tbody>
  13.             <tr>
  14.                 <td>2TB SATA Western Digital</td>
  15.                 <td><span id="prodAmount">32</span></td>
  16.                 <td>IS102</td>
  17.                 <td><input type="text" id="amount" placeholder="Amount.." /> <input type="button" value="Sell"> <span id="status"></span></td>
  18.             </tr>
  19.             <tr>
  20.                 <td>480GB SSD Samsung</td>
  21.                 <td><span id="prodAmount">19</span></td>
  22.                 <td>IS020</td>
  23.                 <td><input type="text" id="amount" placeholder="Amount.." /> <input type="button" value="Sell"> <span id="status"></span></td>
  24.             </tr>
  25.             <tr>
  26.                 <td>16GB 10600R</td>
  27.                 <td><span id="prodAmount">12</span></td>
  28.                 <td>IS100</td>
  29.                 <td><input type="text" id="amount" placeholder="Amount.." /> <input type="button" value="Sell"> <span id="status"></span></td>
  30.             </tr>
  31.             <tr>
  32.                 <td>8GB 8500U</td>
  33.                 <td><span id="prodAmount">3</span></td>
  34.                 <td>ISO100</td>
  35.                 <td><input type="text" id="amount" placeholder="Amount.." /> <input type="button" value="Sell"> <span id="status"></span></td>
  36.             </tr>
  37.             <tr>
  38.                 <td>32GB 8500U</td>
  39.                 <td><span id="prodAmount">21</span></td>
  40.                 <td>ISO100</td>
  41.                 <td><input type="text" id="amount" placeholder="Amount.." /> <input type="button" value="Sell"> <span id="status"></span></td>
  42.             </tr>
  43.             <tr>
  44.                 <td>4GB 8500U</td>
  45.                 <td><span id="prodAmount">4</span></td>
  46.                 <td>ISO100</td>
  47.                 <td><input type="text" id="amount" placeholder="Amount.." /> <input type="button" value="Sell"> <span id="status"></span></td>
  48.             </tr>
  49.             </tbody>
  50.         </table>
  51.     </div>