How would I, using JavaScript, find this out:
Say I have this HTML:
<element1></element1>
<element2></element2>
<element2></element2>
I would like to detect if there are 2 “element2” elements after my “element1” element. Also, they are not always next to each other.
How would I do this?
Assuming element1 is a
divand element2 is aspan…jsFiddle.