Hi I have a input box that needs to be cloned up to six times, according to the .clone() function, i can do this, but if the input name has to be changed, how to do this.
<label for="input">
<input name="input" id="input" type="text">
</label>
<a href="#" onClick="cloneInput()">Add Another Input</a>
So let’s say when a new input is created it should add an increment to the name and id, ie: name="input2" id="input2" and so on, each time the object is cloned.
Anyone have any suggestions on the best/easiest way to do this with jQuery?
First of all remove inline event handling use jQuery and instead of using
cloneyou can try this.Markup
JS