You are using :last-child Selector which selects all elements that are the last child of their parent.
You will need to use :last Selector that selects the last matched element.
th = $("table#dataTable.xLookup thead#PickerTHEAD tr th:visible:last");
console.log(th.html());
| |
Option ID |
My Description |
QTY |
Unit Price |
nj1 |
nj2 |
...
...