Dynamic html elements in erb file

I have a huge table in database and need to fill the values using web
Some fields are repeatable so my form can have a link to provide same
form many times.
I can acheive this by using java script but how to get id of elements
added dynamically.
For example if I add one

containing 1 text box 1 combobox, how
to get ids so that I can use them in my erb file.