我有這個名單OL如何給包含選定文本的li賦予ID?
<ol><li class="first"><a href="/ivory/node/183">Sour Candy Spray 8.5ml (3 flavors)</a></li>
<li><a href="/ivory/node/181">Chap Ice Mini Stick 3g (Cherry)</a></li>
<li><a href="/ivory/node/180">Chap Ice Mini Stick 3g (Kiwi)</a></li>
<li><a href="/ivory/node/179">Chap Ice Mini Stick 3g (Orange)</a></li>
<li><a class="active" href="/ivory/node/166">Chap Ice Beeswax</a></li>
<li><a href="/ivory/node/165">Chap Ice Cherry Stick</a></li>
<li><a href="/ivory/node/170">Chap Ice Crazy Flavors 4.2g (Blueraspberry)</a></li>
<li><a href="/ivory/node/169">Chap Ice Crazy Flavors 4.2g (Watermelon)</a></li>
<li><a href="/ivory/node/168">Chap Ice Crazy Flavors Verry Berry 4.2g</a></li>
<li><a href="/ivory/node/167">Chap Ice Moisture 4.2g Stick</a></li>
<li><a href="/ivory/node/164">Chap Ice Original 4.2g Stick</a></li>
<li class="last"><a href="/ivory/node/163">ChapIce 10G Petrolium Jelly Squeeze Tube</a></li>
</ol>
如何找到包含「章冰櫻桃棒」的李,並給它一個唯一的ID?
我想這個代碼 如果($( 「李一」)。HTML(「章冰蜂蠟「)){ this.parent()。addClass(」selected「); } –
@Chanckjh這是幫助網站。如果你有一百萬的聲望,你將不會獲得獎勵。 –