Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这段代码会提醒元素的索引位置:
var qq = $('li').index('*'); alert(qq);
问题是它li在 iframe 中。我想我必须做类似的事情:
li
var qq = $('iframe').contents().find('li').index('*'); alert(qq);
但它不起作用。它给我-1作为不好的索引。
-1