Your $("input.frage") within your each function would give you all questions for every each iteration.
First you need to find the "common root" object of your current question (the row): var row = $(this).parent().parent(); Then you update all child inputs. Maybe you add a second, general class "beruf" to your check boxes, then you can filter more precisely: ("input.beruf").val(...) $("input.frage").each(function () { var output = $(this).val(); var row = $(this).parent().parent(); row.find("input").val(output); console.log(output); }); by(e) Stephan 2009/1/29 tlob <tlohb...@gmail.com>: > > Hello I have problems iterating with each() and traversing in jQ. > can you help me out with a slick example? > > thx a lot! > > > $("input.frage").each(function () { > var output = $(this).val(); > //$("input.frage").nextAll().val(output); /*NOT > WORKING*/ > console.log(output); > }); > > .....many TRs before.... > <tr> > <td><input class="frage" type="checkbox" value="Sicherer > Arbeitsplatz" /> Sicherer Arbeitsplatz</td> > <td><input class="beruf1" type="checkbox" value="beruf1[]" > /></td> > <td><input class="beruf2" type="checkbox" value="beruf2[]" > /></td> > <td><input class="beruf3" type="checkbox" value="beruf3[]" > /></td> > </tr> > <tr> > <td><input class="frage" type="checkbox" value="Chance, > Arbeitsplatz > zu finden" /> Chance, Arbeitsplatz zu finden</td> > <td><input class="beruf1" type="checkbox" value="beruf1[]" > /></td> > <td><input class="beruf2" type="checkbox" value="beruf2[]" > /></td> > <td><input class="beruf3" type="checkbox" value="beruf3[]" > /></td> > </tr> > .....many TRs after.... > > ...should become > <tr> > <td><input class="frage" type="checkbox" value="Sicherer > Arbeitsplatz" /> Sicherer Arbeitsplatz</td> > <td><input class="beruf1" type="checkbox" value="Sicherer > Arbeitsplatz" /></td> > <td><input class="beruf2" type="checkbox" value="Sicherer > Arbeitsplatz" /></td> > <td><input class="beruf3" type="checkbox" value="Sicherer > Arbeitsplatz" /></td> > </tr> > <tr> > <td><input class="frage" type="checkbox" value="Chance, > Arbeitsplatz > zu finden" /> Chance, Arbeitsplatz zu finden</td> > <td><input class="beruf1" type="checkbox" value="Chance, > Arbeitsplatz zu finden" /></td> > <td><input class="beruf2" type="checkbox" value="Chance, > Arbeitsplatz zu finden" /></td> > <td><input class="beruf3" type="checkbox" value="Chance, > Arbeitsplatz zu finden" /></td> > </tr>