<!DOCTYPE html><html>? ? <head>? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />? ? ? ? <title>挑戰(zhàn)題</title>? ? ? ? <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>? ? </head>? ? <body>? ? ? ? <ul>? ? ? ? <li>11</li>? ? ? ? <li>22</li>? ? ? ? <li>33</li>? ? ? ? <li>44</li>? ? ? ? <li>55</li>? ? ? ? <li style="display:none">66</li>? ? ? ? <li style="display:none" >77</li>? ? </ul>? ? <div></div>? ? <a href="#" >更多</a>? ? ?</body>? ? <script type="text/javascript">? ? ? $("a").click(function(){? ? ? ? var text=$("a").html();? ? if(text=="更多"){? ? ? ? $("li:hidden").html();? ? ? ? $("a").html("隱藏");? ? ?}? ? ? else if(text=="隱藏"){? ? ? ? $("li:visible").html();? ? ? ? $("a").html("更多");? ? ?}});?? ? </script></html>求教jquery代碼何處錯誤,為何無法執(zhí)行隱藏與顯示更多操作??
求教jquery代碼何處錯誤,為何無法執(zhí)行隱藏與顯示更多操作??
xue111
2016-01-02 15:01:24