Use filter()
to pass each item in the collection through a function that returns true if the item should be included:
selectedTD = table
.find('td')
.filter(
function() {
return this.innerText === keyID
});
ETA:
If you can control the HTML generated I suggest you add the keyID as a data-
attribute such as <td data-keyid="keyhere">
. Then you can simply use $('td[data-keyid=' + keyID + ']')