[英]In Tritium,how to select li which have the same class as other?
<ul class="parent">
<li class="abc">1</li>
<li class="abc">2</li>
</ul>
How to select li which have the same class as other? 如何选择与其他同等级的锂?
$('./ ul [@ class =“ parent”] / li [contains(text(),“ 1”)]')这是一种使用文本功能选择任何li的方式
This will also work: 这也将起作用:
$('//ul[@class="parent"]/li[1]') #Targets the first "<li>".
$('//ul[@class="parent"]/li[2]') #Targets the second "<li>".
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.