I've looked around at a few answers to similar questions but I don't fully understand the answers.
I have a form with a table in it which contains some inputs, as below...
<table class="form right 40 rewardclone_1">
<tr>
<td><label for="financial_goal_1">Amount</label></td>
<td>Pledge <span class="dollar">$</span><input id="financial_goal_1" class="text dollars" type="text" name="financial_goal_1" /> or more</td>
</tr>
<tr>
<td><label for="maximum_1">Maximum</label></td>
<td><input id="maximum_1" class="text dollars" type="text" name="maximum_1" /> available (blank for unlimited)</td>
</tr>
<tr>
<td><label for="reward_1">Reward:</label></td>
<td><textarea id="reward_1" name="reward_1"></textarea></td>
</tr>
</table>
I've managed to create a button which clones this entire table when clicked.
$('#add_reward').click(function() {
$('.rewardclone').clone().appendTo('#rewards_container');
});
The problem is I need all those numbers on the attributes (reward_1, maximum_1, etc.) to increment each time the table is cloned.
Any help would be greatly appreciated!
jQuery level: Beginner.
Thanks.