<ul class="parent"> <li class="abc">1</li> <li class="abc">2</li> </ul>
How to select li which have the same class as other?
$('./ul[@class="parent"]/li[contains(text(),"1")]') This is a way you can select any li using text function
This will also work:
$('//ul[@class="parent"]/li[1]') #Targets the first "<li>". $('//ul[@class="parent"]/li[2]') #Targets the second "<li>".
$('./ul[@class="parent"]/li[contains(text(),"1")]') This is a way you can select any li using text function