日期:2014-05-17  浏览次数:20724 次

新手学jQuery,问一个新手问题,达人来帮下忙
<html>
  <head>
  <script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
  $("p").hide();
  });
});
</script>
  </head>
  
  <body>
  <h1>This is my HTML page.</h1>
<p>qqqqqq.</p>
  <p>fwwfw.</p>
<button>Click me</button>
  </body>
</html>

RT为什么不能隐藏p的内容

------解决方案--------------------
这个是用jquery的来实现点击button后产生隐藏<p>元素,如果没有作用,要先看看jquery有没有加载正确,也就是说 <script type="text/javascript" src="jquery.js"></script>中的jquery路径是否正确!