完全菜鸟求帮助。
javascript吧
全部回复
仅看楼主
level 3
低分贝love 楼主
<style>
li { display:list-item}
</style>
</head>
<body>
<ul class="main_right">
<li><p><a href="#">小松的口袋里</a></p></li>
<li><p><a href="#">的口小松袋里</a></p></li>
<li><p><a href="#">的口小袋里松</a></p></li>
<li><p><a href="#">多发点pc520</a></p></li>
<li><p><a href="#">多发200点pc</a></p></li>
</ul>
<a href="javascript:" onclick="aa()" id="saix">小松</a>
</body>
</html>
<script>
function aa(){
var e=$("#saix").html();
$(".main_right li").each(function(index, element){
$(this).find(e).each(function(){
if($(this).html!==e){
$(this).css("display","none");
}
});
})
}
</script>
点击小松想把li里面没有小松的隐藏。求大神。跪求!
2015年06月01日 03点06分 1
level 1
1.你没有引 jQuery.js 文件。
2.find那找e 根本就找不到
2015年06月01日 03点06分 2
有引用
2015年06月01日 07点06分
level 9
$(".main_right li:not(:contains('小松'))").hide();
2015年06月01日 13点06分 3
level 9
用正则匹配下 小松
2015年06月02日 00点06分 4
level 9
用正则匹配下 小松
2015年06月02日 00点06分 5
1