I have a form that generates divs. I have applied a base ID to each div but I need to add numbers to them to differentiate between them.
I have read up on Index and looked at other example but I can’t get it to work here, it seemed to throw a wobbly when I put the num variable in. Anyway I took out the code that was breaking it.
Here is the fiddle, http://jsfiddle.net/clintongreen/BMX4J/13/
Thanks
val()is not correct here.val()is for input elements.When you do:
Change it to:
And do
var num = 0;outside of the function.