yhkqwkz446 2016-04-05 06:59 采纳率: 0%
浏览 1333

请问下面的jquery代码为何不起作用

 1 <html xmlns="http://www.w3.org/1999/xhtml">
 2 <head>
 3 <script type="text/javascript" src="jquery.js"></script>
 4 <script type="text/javascript">
 5     $(document).ready(function () {
 6         $(".ex.hide").click(function () {
 7             $(this).parents(".ex").hide("slow");
 8         });
 9     });
10 </script>
11 <!--样式定义-->
12 <style type="text/css">
13 div.ex
14 {
15  background-color:#e5eecc;
16  padding:7px;
17  border:solid 1px #c3c3c3;   
18  }
19 </style>
20 
21 </head>
22 <body>
23 <h3>Island Trading</h3>
24 <div class="ex">
25 <button class="hide" type="button">Hide me
26 </button>
27 <p>Contact:Helen Bennett<br />
28 Garden House Crowther Way<br />
29 London
30 </p>
31 </div>
32 
33 <h3>Pairs Trading</h3>
34 <div class="ex">
35 <button class="hide" type="button">Hide me</button>
36 <p>Contact:Marie Bertrand<br />
37 265,Boulevard Charonne<br/>
38 Pairs
39 </p>
40 </div>
41 </body>
42 </html>
  • 写回答

5条回答

  • Go 旅城通票 2016-04-05 07:31
    关注

    注意用空格隔开

      $(".ex .hide").click(function () {
    
    评论

报告相同问题?

悬赏问题

  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误