![](/img/trans.png)
[英]How to get index, position number of element with certain class with jQuery
[英]jQuery - get the index of a element with a certain class
我有一個像這樣的列表:
<li> .... </li>
<li> .... </li>
<li> .... </li>
<li class="active"> .... </li>
<li> .... </li>
我想找出具有“active”類元素的項目的索引(列表中的數字)。 在這種情況下,索引將是4(如果我們從0開始,則為3)我該怎么做?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.