Я хочу перебрать набор входных данных, вложенных в группы и разделы,
с целью проверки работоспособности в каждой группе и разделе
<script src="jquery/jquery.js"></script>
<div id="groupA" class="preGroups">
<div id="section-A1">
<input name="SRPR1" type="text">
<input name="SRPR2" type="text">
</div>
<div id="section-A2">
<input name="SRPR1" type="text">
<input name="SRPR2" type="text">
</div>
<div id="section-A3">
<input name="SRPR1" type="text">
<input name="SRPR2" type="text">
</div>
<div id="section-A4">
<input name="SRPR1" type="text">
<input name="SRPR2" type="text">
</div>
</div>
<div id="groupB" class="preGroups">
<div id="section-B1">
<input name="SRPR1" type="text">
<input name="SRPR2" type="text">
</div>
<div id="section-B2">
<input name="SRPR1" type="text">
<input name="SRPR2" type="text">
</div>
<div id="section-B3">
<input name="SRPR1" type="text">
<input name="SRPR2" type="text">
</div>
</div>
<script>
// capture all groups
groups = $('div#[id^=group]');
console.log(groups);
// iterate through each group in groups
$.each(groups, function(key, group) {
console.log(group);
// iterate through each section in group
sections = $('div#[id^=section]');
$.each(sections, function(key, section) {
console.log(section);
// iterate inputs in each group
// more code goes here
/// console.log(input.name + " " + input.value);
});
});