How to find closest table jQuery

I am trying to get the closest table when I search for a value.

This is my code but I always get 'undefined'.

jQuery :

 $(function() {
     $("#searchValue").keyup(function() {


<input type='text' name='searchValue' id='searchValue'/>

<table id='tablePlanning' class='tablesorter'>
            <th>PR Code</th>
            <th>Project status</th>
            <th>Project Leader</th>
            <th>Account manager</th>
            <th>Start Datum</th>



Try to use .next() to find the following table (at the same DOM level) instead :

$(function() {
   $("#searchValue").keyup(function() {

.closest() is to find the first parent of the element.

But since your table has an id, you should use it (I hope you don't have several tables with the id #tablePlanning otherwise, you should use a classname.

Need Your Help

Reverse list of objects inside a list of object using linq linq linq-to-objects

I've a list of class type hotel which internally consists list of other class rooms. Now when i perform a descending sort i sort hotels in descending order but i also have to internally sort the ro...

jQuery Mobile changePage()

php javascript jquery redirect

From this.php, if you click a button, changePage(#here) will execute.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.