Hi guys ![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
How would you create a DOM hierarchy with HTML first, so that you can manipulate it later with Javascript?
For example, here is a sample of a table :
What I want is to have all the childs of row_1 get deleted when I dynamically delete row_1 with removeChild().
Instead of a table, is the use of nested divs the only way to go?
Thanks for the help !![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
How would you create a DOM hierarchy with HTML first, so that you can manipulate it later with Javascript?
For example, here is a sample of a table :
Code:
...
<tr id="row_1">
<td> This is a root row </td>
</tr>
<tr id="row_2">
<td> This should be a child of row_1 </td>
</tr>
<tr id="row_3">
<td> This should be another child of row_1 </td>
</tr>
<tr id="row_4">
<td> This should be a child of row_3 </td>
</tr>
<tr id="row_5">
<td> This is another root row </td>
</tr>
<tr id="row_6">
<td> This should be a child of row_5 </td>
</tr>
...
What I want is to have all the childs of row_1 get deleted when I dynamically delete row_1 with removeChild().
Instead of a table, is the use of nested divs the only way to go?
Thanks for the help !