0
点赞
收藏
分享

微信扫一扫

jquery的顶级对象-5

年夜雪 2022-06-11 阅读 50
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./js/jquery.min.js"></script>
<style>
div {
width: 100px;
height: 100px;
background-color: black;
}
</style>
</head>

<body>
<script>
/* $(document).ready(function(){
$('div').hide();
}) */
//两种方式等价
/* $(function() {
alert(11);
}); */
jQuery(function(){
alert(1);
});
//$是jquery的顶级对象
</script>
<div></div>

</body>

</html>


举报

相关推荐

0 条评论