Search code examples
moovwebtritium

In Tritium, How to insert any element between the children second and third anchor tag?


 <div class="parent">
 <a class="cld1">1</a>
 <a  class="cld2">2</a> 
 <a  class="cld3" >3</a> 
 <a  class="cld4" >4</a>       
</div>

How to insert any element between the children second and third anchor tag?


Solution

  • $('//div[@class="parent"]/a[@class="cld2"]') {
            insert_after('div','hii')
        } 
    

    You can do like this to inset div in between tag Refer http://tester.tritium.io/18f12697fde014066894af356915af1471782732