I have a table with a list of names in column 1 and i'm looking to find the row index if the table contains a certain value.
What I've tried:
var nameToSearch = "Bob";
var index = $("#table-names tr").index(nameToSearch);
console.log(index);
But I just keep getting the same result "-1" indicating the value was not found. Although I know the value is in there. Am I getting something wrong?
.index()method.