I have some HTML as follows:
<td>
<tr>
<input type="button" name="confirm" id="confirm1" tabindex="12" size="25"
value="Confirm" class="inputbox autowidth" title="confirm address" />
</tr>
</td>
I have a script with the following code:
$("#confirm1").click(function(){…}
$("#confirm2").click(function(){…}
These are very similar except with 1, 2...10 etc... at the end which determines what to do.
How do I write it like:
$("#confirm" + id).click(function(){…}
I want to be able to use the id
as a variable and have one function rather than 10 smaller ones.