How can I find the parent tr from the closest child tr e.g. from the second child tr, how can I get to the first parent tr? Below is the html table: <table> <tr class="menu"> <td><input type='text' class='parent' value='First Parent'></td> </tr> <tr class="submenu"> <td><input type='text' class='child' value='First Child'> </td> </tr> <tr class="submenu"> <td><input type='text' class='child' value='Second Child'> </td> </tr> <tr class="menu"> <td><input type='text' class='parent' value='Second Parent'></td> </tr> <tr class="submenu"> <td><input type='text' class='child' value='First Child'> </td> </tr> </table> I have tried the following JQuery code: $(this).closest('tr.submenu').closest('tr.menu').find('.parent').val(); $(this).closest('tr.submenu').parent('tr.menu').find('.parent').val(); $(this).closest('tr.menu').find('.parent').val(); $(this).closest('tr.submenu').prevUntil('tr.menu').find('.parent').val(); $(this).closest('tr.submenu').parentsUntil('tr.menu').find('.parent').val(); $(this).closest('tr.submenu').parents(':first-child').find('.parent').val(); All attempts have failed. How can I get the parent …

Member Avatar
Member Avatar
+1 forum 3

I am doing a school project which is an airplane collision detection system. Can anyone show me a few examples or pseudocode of implementation of closest pair algorithm O(n^2), O(n log^2 n), O(n log n)?

Member Avatar
Member Avatar
+0 forum 10

The End.