jQuery - 当类多次显示时如何获取当前的div id

时间:2018-04-29 16:50:34

标签: jquery

jQuery新手。我有一个' resultsDiv' div使用从数组中检索的数据呈现多个表div。

enter image description here

当我点击“添加子任务”时icon我将新单元格附加到当前行。我终于能够使用以下内容查看表的id。以下显示" Finance"。

$("div.table").closest("div").prop("id");

我怎样才能看到'去景点'或者'旅行'当我追加到当前列表。

感谢您的评论!

1 个答案:

答案 0 :(得分:0)

$(this).closest("div").prop("id");

应该有效

相关问题