以下语句给出了该类的第一个元素titanic
element = document.querySelector('.titanic');
我如何检索具有相同类的第二个元素?
Use document.querySelectorAll https://developer.mozilla.org/en-US/docs/Web/API/Document.querySelectorAll
document.querySelectorAll('.titanic')[1]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)