Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
8835 มุมมอง

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 ....

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
t-att-href url get error แก้ไขแล้ว
2
เม.ย. 23
8549
3
เม.ย. 21
8379
3
ก.ย. 20
4482
How to add notebook via xpath แก้ไขแล้ว
2
มิ.ย. 20
5654
2
เม.ย. 20
6254