-1
我試圖隱藏有一個特殊的簽名,即具有子 「成爲-A-成員」 鏈接:使用此jQuery腳本隱藏的特殊鏈接
<a href="../become-a-member.html">Sign Up</a><br/>
<a href="someothertarget">keep this link</a>
:
$(document).ready(function() {
$("a").each(function(i,e) {
h = $(e).attr("href");
if (~h.indexOf("become-a-member")) $(e).hide();
});
});
它失敗,請參閱https://jsfiddle.net/xq7Luwwn/
什麼是您預期的輸出? –
只顯示第二個鏈接 – Stefan
好的,查看我的回答 –