I\'m not very familiar with jQuery selectors, so would like some help.
I have a table like this:
-
2020-12-19 05:01
This should work...
$(function() {
var searchText = "Section Heading 3";
var output = "";
$("td").each(function(i, item) {
if($(item).html() == searchText) {
output = $(item).html();
output += $(item).closest("td").html()
}
});
console.log(output);
});
Here's a jsFiddle http://jsfiddle.net/5ELLM/
|