I have a Variable in my javascript assume var oneTR= $("#Grp1");
, And I can combine group of 3 TRs to a Combined
Row using this solution.
What I want is:
Get all the
inputs
after secondtextarea
in one combined row<table id="t01"> <tr> <th>HEAD 1</th> <th>HEAD 2</th> <th>HEAD 3</th> </tr> <tr id="Grp1"> <td>Grp1 data</td> <td>Grp1 data</td> <td>Grp1 data</td> </tr> <tr> <td>Grp1 data</td> <td>Grp1 data</td> <td><textarea></textarea></td> </tr> <tr> <td>Grp1 data</td> <td><textarea></textarea></td> <td><input type="text"><input type="text"></td> <td><input type="text"><input type="text"></td> <td><input type="text"></td> </tr> <tr id="Grp2"> <td>Grp2 data</td> <td>Grp2 data</td> <td>Grp2 data</td> </tr> <tr> <td>Grp2 data</td> <td>Grp2 data</td> <td><textarea></textarea><input type="text"></td> </tr> <tr> <td><textarea></textarea></td> <td><input type="text"><input type="text"></td> <td><input type="text"><input type="text"></td> <td><input type="text"></td> </tr> <tr id="Grp3"> <td>Grp3 data</td> <td>Grp3 data</td> <td>Grp3 data</td> </tr> <tr> <td>Grp3 data</td> <td>Grp3 data</td> <td><textarea></textarea><input type="text"></td> </tr> <tr> <td><textarea></textarea></td> <td><input type="text"><input type="text"></td> <td><input type="text"><input type="text"></td> <td><input type="text"></td> </tr> </table>
I tried solution like this:
var finalinps = oneTR.add(oneTR.nextUntil("#Grp2")).find("textarea").eq(1).nextAll(":input");
console.log("finalinps: ", finalinps.length); //finalinps: 0
but this is not working. Here is the JSFiddle
Note - I'm getting proper textarea
with this line but not just inputs
oneTR.add(oneTR.nextUntil("#Grp2")).find("textarea").eq(1)