3-13编程题<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src=" type="text/javascript"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<title>挑战题</title>
</head>
<body>
<ul>
<li style="display:none" title="水果">苹果</li>
<li style="display:none" title="水果">梨</li>
<li style="display:none" title="水果">猕猴桃</li>
<li style="display:none" title="水果">桃子</li>
<li >黄瓜</li>
<li >番茄</li>
<li >西瓜</li>
<li >柚子</li>
</ul>
<a href="#">更多</a>
<script>
$(function(){
$("a").click(function(){
if($("a").text()=="更多"){
$("a").text("简明");
$("li[title='水果']").css("display","list-item");
}
else{
$("a").text("更多");
$("li[title='水果']").css("display","none");
}
});
});
</script>
</body>
</html>
添加回答
举报
0/150
提交
取消