Find current Table ID in a HTML where we have multiple tables

Find current Table ID in a HTML where we have multiple tables

Hello everyone,

Well, I have been using JQuery in the past 6 months and I really got in love with it!

Finally, I've come to an issue that (probably) have better solution than the one Im trying to do with.
Namely, here is the scenario (shortly).

I have multiple tables in a HTML
i.e.
<table id="myTable1"> <tbody> <tr> <td> ... </td> <td> ... </td> </tr> </tbody> </table>
<table id="myTable2"> <tbody> <tr> <td> ... </td> <td> ... </td> </tr> </tbody> </table>
...
all of these tables are some kind of gridviews filled with data using JSon and JQuery.

The problem is:
Before filling with data, only this part in the DOM is created
<table id="myTableId"> <tbody> ! -
so, before going forward with filling the table with data and creating <tr>'s and <td>'s, I would like to find the current (not filled one) table ID.

The algorithm would be:
1. <table id="mytableId"> is generated
2. right after #1, find table ID.
3. Depending of the table ID, generated data accordingly. (Continue with creating tr's and td's)

I have tried using closest('table'), also using find(), parent(), parents() and some other methods with which I've been working previously, but still no success.

I can find the table by uing var tId = $(TABLE['id*='myTable']").attr('id');, but this finds all tables with 'myTable' and I want to find only the one that is created at that moment and waits for filling with data.

I hope I've explained well.

Meanwhile, if I find solution, I will post back.

Thank you in Advance,
H