mardi 20 septembre 2016

Unknown behavior in jquery

I am trying to hide the rows in a table, that have an empty cell. Also I want to know that how many cells are empty. I am using the following code for it:

    $(document).ready(function () {
        emptyCellCount = $('table tr').find('td:empty').length;

        $('table tr').find('td:empty').parent().hide();
    });

When I do alert(emptyCellCount), value is equal to number of empty cells. However, the rows with empty cells are not hiding.

What could be the error in it?




Aucun commentaire:

Enregistrer un commentaire