clear table jquery

后端 未结 10 1598
耶瑟儿~
耶瑟儿~ 2021-01-30 05:03

I have an HTML table filled with a number of rows.

How can I remove all the rows from the table?

10条回答
  •  时光取名叫无心
    2021-01-30 05:40

    Slightly quicker than removing each one individually:

    $('#myTable').empty()
    

    Technically, this will remove thead, tfoot and tbody elements too.

提交回复
热议问题