I am trying to access the text of the first "th" element of the first element of "rows" with jQuery and would like to do so in one line
var currentStation = $(rows[0]).find("th")[0].text();
What would be the correct syntax to do so? I am able to get the "th" element, but as soon as I try to access the text I get error messages. I already tried numerous variations of different brackets combinations, but each one threw me errors.
html?[0]at the end - this accesses the element, not the jQuery object, which is why.text()will no longer work as that's for jQuery only. Replacing.text()with.innerTextshould work.var text = rows[0].cells[0].innerText;?