The following statement gives me the first element with the class titanic
element = document.querySelector('.titanic');
How would I retrieve the second element with the same class?
Use document.querySelectorAll
document.querySelectorAll
document.querySelectorAll('.titanic')[1]
2.1m questions
2.1m answers
60 comments
57.0k users