我想使用普通JavaScript從以下DOM結構中找到文本片段「This is for testing selector」。使用JavaScript查找元素的文本子元素
<html>
<body>
<div class="breadcrumb">
<a title=" Home" href="http://www.google.com/"> Home</a>
<span class="arrow">»</span>
<a title="abc" href="http://www.google.com/">test1</a>
<span class="arrow">»</span><a title="xyz" href="http://www.google.com/">test2</a>
<span class="arrow">»</span>
This is for testing selector
</div>
</body>
</html>
JSoup是你的朋友 –
nopes ......只有JavaScript – user2940827
可以請你澄清你的問題是什麼 – Maxwelll