jq核心函数
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="js/jquery-1.12.4.js"></script>
<script>
$(function () {
alert("hello lnj");
var $box1 = $(".box1");
var $box2 = $("#box2");
console.log($box1);
console.log($box2);
var $p = $("<p>我是段落</p>");
console.log($p);
$box1.append($p);
var span = document.getElementsByTagName("span")[0];
console.log(span);
var $span = $(span);
console.log($span);
});
</script>
</head>
<body>
<div class="box1"></div>
<div id="box2"></div>
<span>我是span</span>
</body>
</html>
jq对象
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="js/jquery-1.12.4.js"></script>
<script>
$(function () {
var $div = $("div");
console.log($div);
var arr = [1, 3, 5];
console.log(arr);
var obj = {0:1,1:2,2:3,length:1111};
console.log(obj);
});
</script>
</head>
<body>
<div>div1</div>
<div>div2</div>
<div>div3</div>
</body>
</html>
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/9c7bc1f19a79a48ec4141b889c549c88.png)