<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jQuery分组选择器</title>
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(function(){
// 注意:#content.title,.header.title无效
$('.header, div.title, [title="foot"]').css('backgroundColor','red');
});
</script>
</head>
<body>
<div class="header">header
<div class="title">title</div>
</div>
<hr>
<div id="content">
content
<div class="title">title</div>
<div class="context">context</div>
<div class="other">other</div>
</div>
<hr>
<footer title='foot'>footer</footer>
</body>
</html>