Correction status:Uncorrected
Teacher's comments:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
</head>
<body>
<div class="one" id='red'>div1 div1</div>
<div class="two" id='blue'>div2 div2</div>
<p id='f'>fff</p>
<div class="three" id='gray'>
<p id='a'>aaa</p>
<p id='b'>bbb</p>
<p id='c'><span>ccc</span></p>
<p id='d'>ddd</p>
</div>
<p id='e'>eee</p>
<p id='h'>hhh</p>
<p id='i'>iii</p>
<script>
console.log( $('#red') ); // 通过 #id 调出div1
console.log($('.two')); //通过 .class调出div2
console.log($('p')); // element 调出全局p 5个
console.log($('div')); // element 调出全局div 共3个
////////////////////////////////
console.log($('div p')); //全局div下所有p,包含子级和孙子级
console.log($('#gray p')); //调用id为gray下的所有p,包含子级和孙子级
console.log($('.three p')); //调用class为three下的所有p,包含子级和孙子级
////////////////////////////////
console.log($('div>p')); //全局div下所有子级p
console.log($('#gray>p')); //调用id为gray下的子级p
console.log($('.three>p')); //调用class为three下的子级p
////////////////////////////////
console.log($('div + p')); //全局div后面的平级p
console.log($('.three + p')); //class为three的后面的相邻平级p;
console.log($('#gray ~ p')); // #gray的后后面的所有平级p
</script>
</body>
</html>