Fastest way to find the index of a child node in parent

前端 未结 9 1593
醉梦人生
醉梦人生 2020-12-13 07:06

I want to find the index of the child div that has the id \'whereami\'.

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 07:22

    Since you are using jQuery. index should do the trick

    jQuery('#whereami').index()
    

    but how are you going to use the index later?

提交回复
热议问题