Mobi Mobi - 1 year ago 62
Javascript Question

How to select second div using jQuery in a webpage?

If a webpage has 2 div tags like


How could I select second div, is it possible using jQuery?

Answer Source

The following will get the second div using the eq method:



Please note that @Cerbrus's answer is also correct, you can do this without jQuery.