Using Jquery to insert a row in parent window table

If we have a table in parent widow:

<table id="demo_table">
  <tbody>
  <tr>
    <td>1</td>
    <td>a</td>
  </tr>
  </tbody>
</table>

Now, we want use jquery to insert a row to this table from a frame.
We can write jquery:

parent.$('#demo_table').last().append('<tr><td>2</td><td>b</td></tr>');

or this way

parent.$('#demo_table > tbody').append('<tr><td>3</td><td>c</td></tr>''); 
affiliate_link
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

Comments are closed.