我想知道如何在提交表單的任何時候向嵌套div中的值添加1。將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的任何幫助將不勝感激。謝謝
當_form是submitted_,頁面會得到'重定向/ reloaded'因此'DOM-manipulations'不會持久.. – Rayon
@RayonDabre合適人選 – uzaif