문제

    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.

도움이 되었습니까?

해결책

Use a DOM traversal function to search from the containing tr.

var two = one.closest("tr").find("input[value='Selecteren']:first").click();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top