jquery多条件选择器
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<script src="jquery-3.3.1.js"></script>
<script>
$(function () {
$('#btn').click(function () {
$('p,strong,div.cls').css('backgroundColor', 'orange');
})
})
</script>
</head>
<body>
<input type="button" name="name" value="效果" id="btn"/>
<p>这是p</p>
<strong>这是strong</strong>
<div class="cls" style="width:50px;height:50px">
</div>
<div style="width:300px;height:200px;background-color:yellow">
</div>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<script src="jquery-3.3.1.js"></script>
<script>
$(function () {
$('#btn').click(function () {
$('p,strong,div.cls').css('backgroundColor', 'orange');
})
})
</script>
</head>
<body>
<input type="button" name="name" value="效果" id="btn"/>
<p>这是p</p>
<strong>这是strong</strong>
<div class="cls" style="width:50px;height:50px">
</div>
<div style="width:300px;height:200px;background-color:yellow">
</div>
</body>
</html>