Skip to content Skip to sidebar Skip to footer

Jquery: .parent() Wont Hide If Numerical Range Begins At 0

I am having some issues with using a numerical range detection within an element, to then hide another element. It seems to work fine when the range starts at 1+, but it breaks at

Solution 1:

Try this:

$("tr.tr-link").each(function() { 
    var num = parseInt($(this).find('td.text-center.td-fit > p').first().text());
    if (num >= 0 && num <= 100) {
        $(this).hide();
    }
});

Solution 2:

I used AdBlock element hider in the firefox add-on store to figure this out. With a few combinations/try's, I found this combination to work

AdBlock Element Hider selection:

THEAD + * TD:first-child + .text-center.td-fit > P

Current working version:

$("THEAD + * TD:first-child + .text-center.td-fit > P").each(function() { 
if ($(this).text() >= 0 && $(this).text() <= 70){
    $(this).parent().parent().hide();
    }
});

Post a Comment for "Jquery: .parent() Wont Hide If Numerical Range Begins At 0"