<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script> <title>挑战题</title> <style type="text/css"> .a { display:block; } .b { display:none; } </style> </head> <body> <ul> <li class="a">啊</li> <li class="a">啊</li> <li class="a">啊</li> <li class="a">啊</li> <li class="a">啊</li> <li class="b">额</li> <li class="b">额</li> </ul> <a href="#" id="aaa">更多</a> <script type="text/javascript"> window.onload=function(){ var x=document.getElementById("aaa"); //var x=document.getElementsByTagName("a"); //var x=$("a"); //alert(x.innerHTML) x.onclick=function() { //x.style.display="none"; if($("a").text()==="更多") { $("a").html("简化"); $(".b").css("display","block"); } else { $("a").html("更多"); $(".b").css("display","none"); } } } </script> </body> </html>
Caballarii
老猿
有的同学
Sweet_Gao
相关分类