How to loop through form elements created with the append function

How to loop through form elements created with the append function

Hello,

How to loop through form elements created with the append function ?

  1. var html = '<tr>'
  2. +'<td><input type="text" name="label[]" class="label width400" value="" required /></td>'
  3. +'<td class="formElem"></td>'
  4. +'<td><input type="text" name="name_column[]" class="name_column" value="" class="width400" required /></td>'
  5. +'<td><button type="button" class="removeColumn">-</button></td></tr>';
  6. var numColumn = $('#numColumn').val();

  7. for (i = 0; i < numColumn; i++) {
  8. console.log('i : ' + i);
  9. $('#table_create').append(html);
  10. $('#table_create').trigger('create');
  11. }
On click  button to validate the form, I would like to check if all form inputs exists / are not empty.
I tried :
  1. $('.label ').each(function(){
  2.       if ( !$(this).val() ){
  3.             alert( "please enter the label");
  4.       }
  5. });
But only the first row is controlled. There is no iteration through the
other inputs from the same class.

Thank you for your help !

Jocelyne