Search code examples
javascripttablesorter

how to get all filtered rows from tablesort.js


I'm using this tablesorter library:- https://mottie.github.io/tablesorter/docs/example-widget-filter-any-match.html

My html page contains of a table with 2 columns, Name and Age. Say, a user has already filtered out all the Names which is aged below 18. How do i get all the rows which match that filter?


Solution

  • You can get the visible rows in the table:

    $('.tablesorter tbody tr:visible');
    

    You can try this in the tablesorter demo page, by running the code in the console.