jQuery封装了JS库,无需担心浏览器兼容问题==


下载官网:http://jquery.com/download/

使用:
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="jquery-2.1.4.min.js"></script>
    <script src="app.js"></script>
    <!--上下不能写反 依赖关系-->
</head>
<body>
    <p>hello</p>
    <p>hello</p>
    <p>hello</p>
    <p>hello</p>
    <p>hello</p>
    <p>hello</p>
</body>
</html>

$(document).ready(function () {
    alert("finish");
});

效果是加载完,弹出对话框

下一个更好玩 :
js改成这样:
$(document).ready(function () {
    //alert("finish");
    $("p").click(function(){
        $(this).hide();
    })
});

点击一个hello消失一个~~