how to select following 2nd sibling in tritium?

75 views Asked by At

I have a parent div with four children div. How do I select the second sibling when there is no class given?

<div class="parent">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
</div>
1

There are 1 answers

0
Sakshi Sharma On BEST ANSWER
$('//div[@class="parent"]/div[2]')

This way second child can be selected directly