Reputation: 786
var one = $("td[data-unit='sword']:first");
var two = /*same tr, different td */ $("input[value='Selecteren']:first").click();
I want to get var two within the same tr as var one by using var one (so I can't just find td X on row X and automatically get var two on the same tr.
Upvotes: 1
Views: 56
Reputation: 782166
Use a DOM traversal function to search from the containing tr
.
var two = one.closest("tr").find("input[value='Selecteren']:first").click();
Upvotes: 1