<html>
<head>
<script src="../../ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("p").has("b,span").css("background-color", "yellow");
});
</script>
</head>
<body>
<h1>Welcome to My Homepage</h1>
<p>My <span>name</span> is Donald.</p>
<p>I live in <span>Duckburg</span>.</p>
<p>My best friend is <b>Mickey</b>.</p>
<p>In this example, we select all p elements that have span or b elements inside of them.</p>
</body>
<!-- Mirrored from www.w3schools.com/jquery/tryit.asp?filename=tryjquery_traversing_has_multi by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:33:45 GMT -->
</html>