Filter insensitive case [on hold]

73
May 26, 2018, at 01:10 AM
this code is in case sensitive, will you give some code not to case sensitive

====================================================================

var $rows = $('tbody > tr'),
    $filters = $('#filter_table input');
$filters.on("keyup", function () {
    var $i = $filters.filter(function () {
        return $.trim(this.value).length > 0;
    }),
        len = $i.length;
    if (len === 0) return $rows.show();
    var cls = '.' + $i.map(function () {
        return this.className
    }).get().join(',.');
    $rows.hide().filter(function () {
        return $('td', this).filter(cls).filter(function () {
            var content = this.textContent,
                inputVal = $i.filter('.' + this.className).val();
            return content.indexOf(inputVal) > -1;
        }).length === len;
    }).show();
});
Answer 1
$rows.hide().filter(function () {
    return $('td', this).filter(cls).filter(function () {
        var content = this.textContent,
            inputVal = $i.filter('.' + this.className).val();
        return content.toLowerCase().indexOf(inputVal.toLowerCase()) > -1;
    }).length === len;
}).show();

The idea is to convert both value to lowercase and compare them

READ ALSO
ESLINT doesn't show any warning

ESLINT doesn't show any warning

It should prompt the warning but it doesn't show any warning(ESLint doesn't show any warning or error)

47
Dynamically applying CSS to JSX objects

Dynamically applying CSS to JSX objects

I'm glad I'm finally making my first post after many years of referring to this websiteA big thank you to everyone here, I'm looking forward to being an active member and positively contribute to the community

64
jQuery Wait for two triggers

jQuery Wait for two triggers

I have two async functions, the first triggers event 1, the second triggers event 2 on finishI want to execute my third function only after the 2 events has been triggered

51