To answer question 1, your code is trying to find an element with an index greater than 0, so it finds the second. Try to remove gt . This will find the element with index less than 1, so it will match the element with index 0.
var selectedElements = $("tr").find("th:lt(1)");
But there are better ways to do this, as mentioned in other answers.
source share