Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
8813 Prikazi

Hi all,

Here i want insert a <li> item inside existing <ul>.

I tried this,

XML

<ul id="top_menu">
    <li><a>1</a></li>
    <li><a>2</a></li>
    <li><a>3</a></li>
</ul>
XPATH

  <xpath expr="//ul[@id='top_menu']/li[1]" position="after">
     <li><a>100</a></li>
  </xpath>
I got my new item "100" at last item of <ul>. but i need it in after 1 item.

Thanks in advance..
Avatar
Opusti

You could also use "//ul" position="inside"

Best Answer

I've tested your code, and it works fine with me. As expected ....

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
apr. 23
8537
3
apr. 21
8359
3
sep. 20
4467
2
jun. 20
5617
2
apr. 20
6230