I have a problem.
I need to know what id of input type='text'
the user is typing, and the inputs are generated dynamically. At each new input, a new id is generated with a counter incrementally increasing how much the user needs.
For example ... by default it has only one field, and when it presses the "+" button
A new field with ids "txtOutrosNomes1", "txtOutrosNomes2" and so on
How do I get the name of this id that was typed by the user?
EDITION 1
var divResponsible = $(document.createElement('div')).attr("id", 'respDiv' + contarEmails);
divResponsible.after().html("<div id='contentEmails'><div class='row'> <div class='col-lg-12'><div class='col-lg-3'></div> <div class='col-xs-4 col-lg-4 col-md-4 col-sm-4'><div class='form-group has-feedback' id='divOutrosNomes"+contarEmails+"'>Nome<input type='text' onclick='pegaValues()' class='form-control' name='txtOutrosNomes["+ contarEmails +"]' id='txtOutrosNomes"+ contarEmails +"' placeholder='Fulano da Silva' autocomplete='off' automplete='off'></div></div><div class='col-xs-4 col-lg-4 col-md-4 col-sm-4'> <div class='form-group has-feedback' id='divOutrosEmails" + contarEmails+ "'>E-mail<input type='text' class='form-control' name='txtOutrosEmails[" + contarEmails + "]' id='txtOutrosEmails"+contarEmails+"' placeholder='[email protected]' autocomplete='off' automplete='off'></div><div class='col-lg-1'></div> </div></div> </div></div><div class='msgDados"+contarEmails+"'></div><div class='conteudo-select-partner"+contarEmails+"' style='display: none;'></div> </div>");
divResponsible.appendTo("#groupEmails");
contarEmails++;
I generate my textbox code so ... how would you add bootstrap classes to your solution?