I have a JQuery datatable, that display a search string column. When the user hovers over the row, I want to highlight the corresponding text within a text area.
For example, if the text area contains the following:
this is a place of beauty
And my Datatable row contains:
this is a place
then the text area portion needs to be highlighted.
I've used a couple of plugins, but they only seem to cater, for single word matches, whereas I need to do a sentence search, if you will.
The code I have is :
$('#tblHitData tbody').on('mouseover', 'td', function() {
var data = oHitData.row($(this).parents('tr')).data();
var searchString = data['SearchString'];
if ($("#message:contains('" + searchString + "')")) {
$('#message').highlight(searchString);
};
});