I have input fields with randomly-ordered ids as follows:
<input type="text" id="start1" />
<input type="text" id="start5"/>
<input type="text" id="start3"/>
I need to change it as below, ordering by a 1 to 10 suffix at the end
<input type="text" id="start1" />
<input type="text" id="start2"/>
<input type="text" id="start3"/>
<input type="text" id="start4"/>
How to do it in jQuery?
The above will work for you.
It needs to be said though, that changing IDs on the fly is a rather odd requirement to have. Is there a specific reason you need to achieve this?