[Solved] How to select all cell starting, containing or ending with some word with JQuery/CSS?


you can use regular expressions. These two regexp checks if text contain “John” (anywhere) and ends with “1”:

$('#myTable').find('td').each(function() {
    var str = $(this).text();
    if (str.match("John") && str.match("1$") ) {
        $(this).css('background', 'red'); // ...or do something else with it.
    }
});

3

solved How to select all cell starting, containing or ending with some word with JQuery/CSS?