-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
好的,查看我的回答 –