<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.js" type="text/javascript"></script>
<title>挑战题</title>
</head>
<script>
function change(){
var $str = $("a").html();
if($str=="更多"){
$("li:hidden").show();
$("a").html("简化");
}
else{
$("li[name*='hehe']").hide();
$("a").html("更多");
}
}
</script>
<body>
<ul>
<li>出来</li>
<li style="display:none" name="hehe">隐藏</li>
<li style="display:none" name="hehe">隐藏</li>
<li >出来</li>
<li >出来</li>
<li >出来</li>
<li >出来</li>
</ul>
<a href="javascript:void(0)" onclick="change();">更多</a>
</body>
</html>
lizifengbao
2014-09-19
0 回答
举报
0/150
提交
取消