$("div:has(p)") 选取含有<p>元素的<div>元素
node2:/var/www/html/js#cat t9.html
<div>aaa</div>
<div><p>bbbb</p></div>
<div>ccc</div>
<script type="text/javascript" src="jquery-2.2.2.min.js"></script>
<script type="text/javascript" src="t9.js"></script>
node2:/var/www/html/js#
node2:/var/www/html/js#cat t9.js
$("div:has(p)").css("background", "red");
node2:/var/www/html/js#