How to Check value id from Tag Input and remove count row is 0?

CTRL

Help me please on this jquery: I want remove row if value is '0' but until now on this code, I Just can remove all

$('#refresh').click(function(){
    var tableDestination = $('#example');
    var countTable = tableDestination.length;

    for(var i = 1; i <= countTable; ++i) {
        $('.checklist').each(function(i) {
            var value = $('.checklist').eq(i).val();  

            if (value != 1) {
                //Test Run PerRow
                alert('DeleteValue=' + value + ' ' + 'RowValue=' + i);
                $('tr#DelRow').remove(i);
            }
            else{
                alert('HoldValue=' + value + ' ' + 'RowValue=' + i);
            }
        });

        $('tr#DelRow').remove(i);
    }
});

I'm using switch case LIKE

switch(value){
case '0':
    //Test Run PerRow
    alert('DeleteValue=' + value + ' ' + 'RowValue=' + i);
    break;
case '1':
    //Test Run PerRow
    alert('HoldValue=' + value + ' ' + 'RowValue=' + i);
    break;
}

I want keep the green checklist and red cross to remove

this is Result : http://i.stack.imgur.com/jMocu.png

Kolban

The following will remove all rows from a table which have a column that contains an <input> element that has a value of 0. It is executed when a button on the page is clicked. A jsFiddle is provided to illustrate.

$(function () {
    $('#refresh').click(function () {
        $("#example tr:has(input[value='0'])").remove();
    });
});

The core of the work is in the jQuery selector which is #example tr:has(input[value='0']). The way to read this is:

  • Find the element in the page with an id of example. This will be the table.
  • Find all the tr (table row) children of the table which contain an input element that has a property value of 0.

When we have the list, we execute the jQuery .remove() to remove them from the DOM.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to get tag value from input XML where tag name is stored in a variable

분류에서Dev

get value of input tag from td tag generated by for loop

분류에서Dev

How to remove a line from a tag in shell script?

분류에서Dev

How to check if user input is not an int value

분류에서Dev

How pass javascript function value into input tag value?

분류에서Dev

jQuery to take value from input and check if it's right. If so, it should post how many are correct

분류에서Dev

How to check a class for a certain value and then return a result through Tag Manager

분류에서Dev

How can I match a user id value from a form input to records in my database?

분류에서Dev

How to remove \0 from the array of strings

분류에서Dev

LINQ to remove duplicate rows from a datatable based on the value of a specific row

분류에서Dev

Input tag file value jquery

분류에서Dev

Newbie issue. How to check if input is empty in php, although the input could contain digit 0?

분류에서Dev

How to remove a row from the javascript object based on a field and realign the object

분류에서Dev

How to make tmux count windows starting from 1 instead of 0?

분류에서Dev

Javascript - count and remove from an object

분류에서Dev

php - MySQli row count always returning 0?

분류에서Dev

How to remove borders of the <header> tag?

분류에서Dev

How to remove 0s from dictionary in python

분류에서Dev

Add value of input field to anchor/link tag

분류에서Dev

Remove rows from Dataframe where row above or below has same value in a specific column

분류에서Dev

How to replace input text tag into plain text of it's value using C# regex?

분류에서Dev

Count all rows from a colum, and get 2 different count columns on the result (One for each possible value 1 or 0)

분류에서Dev

Java to MySQL: How to update row with a value from variable?

분류에서Dev

How to add a row and change cell value in DataGridView from a different thread?

분류에서Dev

How to get value from selected row of GridPanel? [Ext.Net]

분류에서Dev

How to check a Radio button from the value of a table of mySQL

분류에서Dev

How to optimize query for optional input id (either one specific row or whole table)

분류에서Dev

How to optimize query for optional input id (either one specific row or whole table)

분류에서Dev

Remove BR tag from the beginning and end of a string

Related 관련 기사

  1. 1

    How to get tag value from input XML where tag name is stored in a variable

  2. 2

    get value of input tag from td tag generated by for loop

  3. 3

    How to remove a line from a tag in shell script?

  4. 4

    How to check if user input is not an int value

  5. 5

    How pass javascript function value into input tag value?

  6. 6

    jQuery to take value from input and check if it's right. If so, it should post how many are correct

  7. 7

    How to check a class for a certain value and then return a result through Tag Manager

  8. 8

    How can I match a user id value from a form input to records in my database?

  9. 9

    How to remove \0 from the array of strings

  10. 10

    LINQ to remove duplicate rows from a datatable based on the value of a specific row

  11. 11

    Input tag file value jquery

  12. 12

    Newbie issue. How to check if input is empty in php, although the input could contain digit 0?

  13. 13

    How to remove a row from the javascript object based on a field and realign the object

  14. 14

    How to make tmux count windows starting from 1 instead of 0?

  15. 15

    Javascript - count and remove from an object

  16. 16

    php - MySQli row count always returning 0?

  17. 17

    How to remove borders of the <header> tag?

  18. 18

    How to remove 0s from dictionary in python

  19. 19

    Add value of input field to anchor/link tag

  20. 20

    Remove rows from Dataframe where row above or below has same value in a specific column

  21. 21

    How to replace input text tag into plain text of it's value using C# regex?

  22. 22

    Count all rows from a colum, and get 2 different count columns on the result (One for each possible value 1 or 0)

  23. 23

    Java to MySQL: How to update row with a value from variable?

  24. 24

    How to add a row and change cell value in DataGridView from a different thread?

  25. 25

    How to get value from selected row of GridPanel? [Ext.Net]

  26. 26

    How to check a Radio button from the value of a table of mySQL

  27. 27

    How to optimize query for optional input id (either one specific row or whole table)

  28. 28

    How to optimize query for optional input id (either one specific row or whole table)

  29. 29

    Remove BR tag from the beginning and end of a string

뜨겁다태그

보관