Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何准确选择带有“Candy”的标签?
<div class="abc"> <a>Candy</a> <a>Candy Chocolate</a> </div>
$('//a[.="Candy"]')
它只选择第一个准确包含文本“Candy”的锚标签