Hi, I am new to Jquery
A form with this hidden field is loaded
<input type = "hidden" class = "counter" value="6">
I use Jquery to do this
var counter = $(".counter:last").val()
then a click event adds a row with this text field
.append($('<input>').attr('type', 'text').attr('name', 'drugName["+counter+"]')
this returns
<input size="40" type="text" name="drugName["+counter+"]">
Where am I going wrong. I tried multiple variations.
Any help/references?