Domanda

    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.

È stato utile?

Soluzione

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

var two = one.closest("tr").find("input[value='Selecteren']:first").click();
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top