Finding the id of a parent div using Jquery

前端 未结 9 1091
失恋的感觉
失恋的感觉 2020-11-29 17:00

I have some html like this:

Volume =

9条回答
  •  半阙折子戏
    2020-11-29 17:42

    This can be easily done by doing:

    $(this).closest('table').attr('id');
    

    You attach this to any object inside a table and it will return you the id of that table.

提交回复
热议问题