How do you append rows to a table using jQuery?

前端 未结 7 1355
渐次进展
渐次进展 2020-12-01 01:34

Hi I was trying to add a row to a table using jQuery, but it is not working.
What might be the reason?

And, can I put in some value to the newly added row..?

相关标签:
7条回答
  • 2020-12-01 01:57

    You should append to the table and not the rows.

    <script type="text/javascript">
    $('a').click(function() {
        $('#myTable').append('<tr class="child"><td>blahblah<\/td></tr>');
    });
    </script>
    
    0 讨论(0)
提交回复
热议问题