`
Dxx23
  • 浏览: 141130 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

jQuery的小测试

阅读更多
<html>
   <head>
     <script type="text/javascript" src="jquery-1.4.js"></script>
     <script type="text/javascript">
       $(document).ready(function(){
           $("p.test2").click(function(){
               $("p#test").hide();
               $("p.test2").css("color","red");
           });
       });
    </script>
   </head>
   <body>
    <p id="test">If you click on the below,I will disappear!</p>
    <p class="test2">If you click on me,I will be red!</p>
   </body> 
</html>

 

 

      下载附件的jquery-1.4.js,把以上代码复制到文本文件中,再把文本文件重命名为html文件。最后把jquery-1.4.js和html文件放一块,打开html文件就能轻松体验jQuery的方便!

     这只是个简单的例子,jQuery就是一个JavaScript库,jQuery库位于单个的JavaScript文件中,其中包含所有的jQuery函数,需要大家自己看jQuery文档,简化各种JavaScript的编程,这就是封装的效应!

 

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics