http://jsfiddle.net/jaredwilli/tZPg4/4/
here I can add and remove unlimited inputs on my page.
My question is how can I make this function to produce maximum 6 more inputs then hiding the “Add Another Input Box” link.
I am a newbie. This question must be really easy for javascript programmers.
See: http://jsfiddle.net/nrabinowitz/38RE6/7/
This implements what everyone else suggested – check the
icounter variable, and hide the link when necessary. Note that you had an error in your code – you can’t add multiple elements with the sameidattribute, so I had to changeid="remScnt"toclass="remScnt"and change the corresponding selector.