第一個JQUERY小例子

来源:互联网 发布:淘宝联盟不能使用红包 编辑:程序博客网 时间:2024/05/09 23:36


<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button[name='button']").click(function(){
      $("p").hide();
    }
  )
  $("button[name='show']").click(function(){
     $("p").show();
  })
;
});
</script>
</head>

<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button" name="button">Click me hide</button>
<button type="button" name="show">show</button>
</body>
</html>

運行效果閽效果圖


原创粉丝点击