0

if in a DOM we have multiple elements having same id/class, then how to locate a particular one using CSS e.g if we have " div class='aa' " repeated 90 times and i want to fetch 80th element, how to do it using CSS, i know how to do it using XPath ( (//div[@class='aa'])[80] ) but don't know in CSS.

Thanks in advance.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
user522170
  • 623
  • 1
  • 6
  • 21
  • 4
    You should never have multiple elements with same `id`. It is not valid. Also, CSS has no `nth-of-class` type selector. For finding nth element of a certain type you could use `nth-of-type`. – Harry Jan 23 '15 at 17:08
  • 1
    If you can do it using XPath, why don't you just use XPath? – BoltClock Jan 23 '15 at 17:09

0 Answers0