identifying which item is clicked in a multi level list using jquery

后端 未结 3 1621
感动是毒
感动是毒 2021-01-23 18:57

my html looks like this

  • Item 1
  • Item 2
  • Item
3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-23 19:27

    You want to get index of selected ul element? Try this:

    var parentInd = $(this).parent().parent().index();

提交回复
热议问题