<!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>
var myDiv = document.querySelector('div'); //mydiv的dom对象
console.log(myDiv);
$('div');
console.log($('div'));
</script>
<div></div>
</body>
</html>
运行结果