首页 🍋Code,🥭笔记

jquery学习 - Day 1

引用jquery

隐藏元素-初次使用jquery(jquery入口函数)

image-20210217220616432

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
    <style>
        div {
            width: 200px;
            height: 200px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div>
fdsahfsjdiofdsfkas
    </div>
    <script>
        $(function(){
            $('div').hide();
        })
        //打开待DOM加载完毕后会隐藏div元素
    </script>
</body>
</html>



文章评论

评论已关闭

目录