0
我試圖搜索但沒有運氣,我有各種元素的元素內部我需要得到的元素類型的按類別選擇它的索引Jquery的獲得元素類型的索引在父
例
<div>
<span></span>
<p></p>
<span></span>
<p></p>
<span class="selected"></span>
//i need to find this and know it's the third span
<p></p>
</div>
感謝您的幫助
'$( '跨')指數($() '選擇');' –
它返回-1 –
'-1'是指數的'的返回值()'當目標元素不能在集合中找到。你確定你在'$('。selected')'包含'$()'包裝嗎? – tommarshall