在onsubmit上添加1到行值

时间:2016-04-11 10:46:16

标签: javascript jquery html

我想知道如何在提交表单的任何时候在嵌套div中为值添加1。

<form id="form1" name="form1" method="post" action="" class="submit">
  <table width="30%" border="0" cellspacing="4" cellpadding="4">
    <tr>
      <td width="58%"><div class="fav_count">1</div></td>
      <td width="42%"><input type="submit" name="button" id="button" value="Submit" /></td>
    </tr>
  </table>
</form>
<form id="form2" name="form1" method="post" action="" class="submit">
  <table width="30%" border="0" cellspacing="4" cellpadding="4">
    <tr>
      <td width="58%"><div class="fav_count">2</div></td>
      <td width="42%"><input type="submit" name="button2" id="button2" value="Submit" /></td>
    </tr>
  </table>
</form>
<form id="form3" name="form1" method="post" action="" class="submit">
  <table width="30%" border="0" cellspacing="4" cellpadding="4">
    <tr>
      <td width="58%"><div class="fav_count">3</div></td>
      <td width="42%"><input type="submit" name="button3" id="button3" value="Submit" /></td>
    </tr>
  </table>
</form>
<form id="form4" name="form1" method="post" action="" class="submit">
  <table width="30%" border="0" cellspacing="4" cellpadding="4">
    <tr>
      <td width="58%"><div class="fav_count">4</div></td>
      <td width="42%"><input type="submit" name="button4" id="button4" value="Submit" /></td>
    </tr>
  </table>
</form>

这是一个小提琴

https://jsfiddle.net/fgu42nxr/

任何有关jquery的帮助都将不胜感激。感谢

0 个答案:

没有答案