As per the documentation:
You can also specify an function that returns the content, which will be run on each consecutive show event. This function can return both static textual content (text or HTML), or a Deferred object (see below) The function is executed with it's scope as the target element, along with both an event and api argument(s) respectively.
So you can do this:
content: {
text: function() {return $(this).closest("tr").find("[title=lname]").text();}
}
The idea is, starting from the target element scope (this
) which we know is a td[title]
, to somehow produce the text for the tooltip. Since the only instance of that text in your markup is inside the td[title=lname]
, the code finds that and returns its text.