跳至內容
選單
此問題已被標幟
2 回覆
8808 瀏覽次數

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..
頭像
捨棄

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

最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
4月 23
8524
3
4月 21
8345
3
9月 20
4459
2
6月 20
5603
2
4月 20
6219