I am unable to access the input field or any of the dynamically created input fields from the following HTML:
<div class="row">
<div class="input_fields_wrap" id="Categories">
<button class="add_field_with_subs">Add More Categories</button>
<div class="input_fields"><input type="text" name="someInput"><a href="#" class="add_sub_field">Add Sub-Categories</a></div>
</div>
</div>
Using the following code gives the proper value of "2":
$("#Categories").children("div").each( () => alert($(this).children.length) );
and the alert will trigger appropriately for each dynamically created field...
However, any attempt to get the value of the appropriate input text field yields a response of "undefined".
I've tried .children("input"), .children(":input"), .last(), .find, etc.
Would anyone be able to advise me on what I'm doing incorrectly, please?