我試圖在通過AJAX獲取的HTML中查找HTML中的特定URL。使用ajax加載html get,然後通過標籤查找特定內容
我已經嘗試使用下面的代碼,但它返回undefined
var url_f_elem = $(html).find(".wb-bnr ~ a").html();
的HTML低於 - 我試圖獲取裏面的A HREF
<header role="banner">
<div id="wb-bnr" class="container">
<section id="wb-lng" class="visible-md visible-lg text-right">
<h2 class="wb-inv">Language selection</h2>
<div class="row">
<div class="col-md-12">
<ul class="list-inline margin-bottom-none">
<li>
<a lang="fr" href="/fr/ministere-defense-nationale/nouvelles/2017/09/la_construction_dunnouveaubatimentamelioreralentretiendevehicule.html">
Français
</a>
</li>
</ul>
</div>
</div>
</section>
'WB-bnr'是類或ID 50如果id使用'$(html).find(「#wb-bnr〜a」)。html();' – XYZ